Which HTTP method is NOT idempotent by definition?
Options
- GET
- PUT
- DELETE
- POST (Correct option)
Answer
POST
Why
Idempotent means: sending the same request once or ten times leaves the server in the same final state.
GET only reads. PUT sets a resource to a given value (setting it twice changes nothing more). DELETE removes it (deleting twice: still deleted).
POST usually CREATES something: two identical POSTs to /orders can create two orders. That is why retrying a POST is risky.
Remember
POST creates → repeating it can create duplicates.