Idempotency

An HTTP guarantee where making an identical request multiple times has the same effect as making it once.

Internet3 min readConcept 16 of 35

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!

Idempotency Visualizer
POST
Non-Idempotent (Coin Slot)
$
$0
Notice how the total keeps growing.
PUT
Idempotent (Pedestal)
$0
Notice how multiple taps leave the exact same state.

Check yourself

Pick an answer to lock it in, then read why. Getting one wrong is part of how it sticks.

  1. 1Which of the following HTTP methods is NOT guaranteed to be idempotent by default?
  2. 2Why is the DELETE method considered idempotent, even if a second identical request to the same URL returns a 404 Not Found?
  3. 3How can a non-idempotent operation like POST be made safely retriable in payment APIs?

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.