News for hackers. Stuff that matters.
Re:Microsoft REST API Guidelines by JMTQp8lwXL on Friday November 22, 2019 @05:05PM (#21610622)
If "idempotent" means "do the same thing", one would expect the same response on a subsequent call, no?

"Do the same thing" isn't specific enough. Does it mean the state of the system? Does it mean the response code? Does it mean the response body? Does it mean all of these things? All seem like reasonable interpretations.

Re:Microsoft REST API Guidelines by alkonaut on Saturday November 23, 2019 @04:21AM (#21613254)
In the context of REST it means the same server state (a database table state, a mailbox state, file system state etc)

It doesn’t mean “do the same thing” or “get the same response”, only “end up in the same place”.

You can do a delete x, get an OK response, and the important state is that x is now deleted on the server. Then the next call to delete x does nothing (which is different from the first which deleted x!). So to be idempotent it has to do something different. The response in the second case can be both “ok” (because the thing is deleted) but also e.g “x doesn’t exist”.