HTTP Methods Idempotence
The cluster debates the correct usage of HTTP methods like GET, POST, PUT, and DELETE, focusing on idempotence, safety requirements, and avoiding side effects or state changes with GET requests.
Activity Over Time
Top Contributors
Keywords
Sample Comments
HTTP GET requests should not be interpreted by the server as a request to change something. That's what POST, PUT, DELETE and PATCH are for.
POST is not defined to be idempotent, although you're correct about PUT and DELETE.
What do I do about the people who tell me POST is only for actions which change server state?
POST, PUT, DELETE are just as much part of HTTP as GET...
That's why it should not be HTTP GET endpoint. Get endpoint should only be when request is idempotent. Use HTTP POST for your usecase.
POST requests typically perform modifications on the server based on user action, like POST'ing this comment. GET requests should be idempotent.
I think this is the argument for PUT instead of POST, not GET instead of POST.
Cool effort, but why are they all POST requests? These should all be GET requests with either path or query parameters. They're not creating any resources on the server side, only fetching existing resources. HTTP 101! :-)
HTTP defines the POST method explicitly as non-idempotent
You meant "POST, PUT, etc"