Middle
Which REST methods are idempotent?
sobes.tech AI
Answer from AI
In REST, idempotent methods are those that, when executed repeatedly with the same parameters, do not change the server's state after the first request. These include:
- GET — retrieves data, does not change state.
- PUT — updates a resource, repeated execution results in the same outcome.
- DELETE — deletes a resource, repeated deletion of the same resource does not change the state.
- HEAD — similar to GET but without the response body, also idempotent.
The POST method is not idempotent, as repeated requests can create new resources or alter the server's state.