The same DELETE request is sent twice:
The two calls return different status codes. Is DELETE's idempotency violated?
DELETE /orders/42 -> 204 No Content
DELETE /orders/42 -> 404 Not FoundThe two calls return different status codes. Is DELETE's idempotency violated?
- aNo — idempotency is about server state, and the order is equally deleted after both calls✓
- bYes — an idempotent method must return the same status code on every repeat, not merely reach the same end state
- cYes — the server should keep returning 204 until the client stops retrying
- dNo — because DELETE was never an idempotent method in the first place
Explanation:Idempotency promises that repeating the request leaves the server in the same state, not that the response is byte-identical. After both calls the order is gone; the 404 merely reports that it no longer exists. Expecting identical status codes (b) is the most common misreading of the definition.