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.

📉 Falling 0.4x Web Development
3,193
Comments
20
Years Active
5
Top Authors
#9314
Topic ID

Activity Over Time

2007
14
2008
26
2009
37
2010
106
2011
154
2012
247
2013
240
2014
156
2015
238
2016
150
2017
169
2018
165
2019
203
2020
95
2021
196
2022
352
2023
274
2024
147
2025
217
2026
7

Keywords

StackOverflow JSON DO SHOULD OK methods.x HTTP REST GET HEAD http delete post request requests body spec payload rest methods

Sample Comments

wcoenen Aug 20, 2021 View on HN

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.

tmhedberg Mar 15, 2011 View on HN

POST is not defined to be idempotent, although you're correct about PUT and DELETE.

lollerpops Sep 24, 2012 View on HN

What do I do about the people who tell me POST is only for actions which change server state?

ako Jan 19, 2014 View on HN

POST, PUT, DELETE are just as much part of HTTP as GET...

vs4vijay Aug 20, 2021 View on HN

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.

karolist Aug 20, 2021 View on HN

POST requests typically perform modifications on the server based on user action, like POST'ing this comment. GET requests should be idempotent.

hateful Feb 10, 2019 View on HN

I think this is the argument for PUT instead of POST, not GET instead of POST.

yawaramin Sep 21, 2021 View on HN

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! :-)

preseinger May 28, 2023 View on HN

HTTP defines the POST method explicitly as non-idempotent

fjsolwmv Jun 5, 2018 View on HN

You meant "POST, PUT, etc"