Idempotency
An HTTP guarantee where making an identical request multiple times has the same effect as making it once.
What it is
An HTTP method is **idempotent** if an identical request can be made once or several times in a row with the same effect while leaving the server in the same state.
In other words, a method is idempotent if it has no additional effect on the server's data if it is called more than once with the same input parameters.
Why it matters
Idempotency is crucial for safe network retries (e.g., when dealing with connection drops, timeouts, or failures).
It prevents disastrous duplicate operations, such as avoiding double charges on a user's credit card, or creating duplicate records if a user impatiently clicks a 'Submit' button twice.
How it works
By design, the HTTP standard categorizes its methods into idempotent and non-idempotent buckets.
**Idempotent methods:** GET, HEAD, PUT, DELETE, OPTIONS, TRACE.
**Non-idempotent methods:** POST, PATCH (PATCH can be idempotent depending on implementation, but is not guaranteed to be).
Try it
Compare a non-idempotent Coin Slot (POST) to an idempotent Pedestal (PUT). Notice how the server state changes with multiple taps!
Check yourself
Pick an answer to lock it in, then read why. Getting one wrong is part of how it sticks.
Remember this
- Idempotency means multiple identical requests yield the same server state.
- GET, PUT, and DELETE are naturally idempotent.
- POST is non-idempotent and requires care (like Idempotency Keys) for retries.
Done with this concept?
Mark it complete to track your progress. No login needed.