You have to think about one action when thinking about idempotency.
If you call DELETE 100 times, it will still be the same item that is deleted, you remove it from memory, the DB or set a field deleted = true or something. Same goes for PUT, you send an update to the server, but you "set" state to a new state, you don't do stuff like "increase value x", "append string to y" or "subtract 10 from z".
Sure the data will be gone for your next GET request if you issued 1 or 100 DELETEs, but the idea is that the 100 DELETEs end in the same state as the 1 DELETEs
You have to think about one action when thinking about idempotency.
If you call
DELETE
100 times, it will still be the same item that is deleted, you remove it from memory, the DB or set a fielddeleted = true
or something. Same goes forPUT
, you send an update to the server, but you "set" state to a new state, you don't do stuff like "increase value x", "append string to y" or "subtract 10 from z".Sure the data will be gone for your next
GET
request if you issued 1 or 100DELETE
s, but the idea is that the 100DELETE
s end in the same state as the 1DELETE
sGotcha!! Thanks buddy :)