Safe and Idempotent Methods
A method is safe when it is intended only for retrieval and does not request a state-changing operation. GET, HEAD, and OPTIONS are safe.
A method is idempotent when making the same request multiple times has the same intended effect as making it once. GET, HEAD, PUT, DELETE, and OPTIONS have idempotent semantics.
Idempotency does not mean the response must be byte-for-byte identical. A DELETE request might return 204 the first time and 404 later while the intended resource state remains deleted.
Idempotency is critical for retries in distributed systems.
Knowledge Check
Why is idempotency important for APIs?