Erik Hetzner wrote:
[…] ‘idempotent’ means repeating the operation ends up with the
resource in the same state (it doesn't mean all the responses are
always identical).
What we're saying is that _because_ the resource is in the same state,
why wouldn't it ALWAYS return the same status code?
If a resource has not changed, when would the status code from the GET
call ever change? It's only when the resource changes is there even a
chance for the status code to change.
Back to DELETE. If a resource is already in the "delete" state, and
then calling another DELETE method on the resource, the resource has not
changed states. Therefore, we should expect the status code to be the
same for both cases.
The first DELETE returns 204 No Content (basically an empty 200 OK).
The second DELETE (according to the idempotent rule) should also return
a 204 status. The resource has not changed, therefore the status code
has also not changed.
I can't explain it better than that.
Again, just think through the example I gave. It's what clarified the
issue for me, at least.
Adam
p.s. Also, if you think about the "delete" state as the "non existing"
state, that helps. A DELETE method simply moves the resource to this
"non existing" state.