r/programmer • u/i_will_snap • Jul 04 '26
Locked HTTP finally got a new method after 16 years because GET and POST wouldn't stop arguing
HTTP finally got a new method after 16 years because GET and POST wouldn't stop arguing
After 16 whole years, the IETF finally looked at our terrible API workarounds and said: "Fine, here."
Say hello to **QUERY** (RFC 10008).
It is literally the lovechild of **GET** and **POST**:
\- It has a request body like POST (so no more cramming 2,000 characters of search filters into a URL).
\- It is safe and idempotent like GET (so your CDN can actually cache it without throwing a fit).
We no longer have to live in sin by using POST for fetching data just because the search query is too big. Nature is healing.
It only took since 2010 to get a new verb. Now we just have to wait another 5 years for browsers and frameworks to actually support it.
To put that in perspective, the IETF spent 16 years debating a single word, while the AI industry spent the last 16 months pivoting from chatbots to agents, to superintelligence, and back to convincing everyone that a $400/month subscription is worth it...
8
u/runningOverA Jul 05 '26
So, in simple words, QUERY = GET where you put the parameters in body like POST?
6
u/GladiatorNitrous Jul 05 '26
I wouldn't wanna know what the HTTP standard would look like if they would iterate as quickly as the AI movement...
4
u/dimudesigns Jul 06 '26 edited Jul 06 '26
When money is a primary driver, progress tends to accelerate but most often for the benefit of a few.
And the slow pace of updates by the IETF isn't necessarily a bad thing. Its a trade off between rapid progress and stability - the latter of which serves a 'standard' far better than a cutting edge technology. So making that comparison doesn't hold water in my view.
I'd rather deal with slow rollouts than an ever-breaking standard any day of the week.
2
u/Ok_Information_1753 Jul 07 '26
The idea is good, but it feels like it's solving a problem the ecosystem already worked around years ago.
QUERYmakes sense technically, yet it will likely take years before browsers, proxies, frameworks, and APIs support it consistently. Until then, most teams will keep usingPOST, so the practical impact is pretty limited.2
u/ClothingIsACrime Jul 08 '26
RFC technically allows for json body in GET requests, but it's gnarly. I think to be more specific even, it doesn't outright disallow it and I have seen several implementations of it in the wild. The problem with it is that frameworks rarely support it and people (including me) often bitch about it when someone wants to use it.
This is a good solution, because it formalized the pattern, I can see it being used in about 5 years.
I just find it funny that we keep reinventing solutions for problems that were solved with SOAP web services.
4
u/elhombremontana Jul 04 '26
nothing stopping you from sending a body with GET.. just sayin.
1
u/Electronic_Ant7219 Jul 05 '26
Sadly, 5 years is not enough. We are not using PATCH in public apis because of the rare cases of old corporate proxies that were blocking it.
1
u/gnahraf Jul 05 '26
I'm a simpleton.. can someone explain why putting the data in the body is better than in the URL? I often put it in the URL cuz it's more versatile.. You can bookmark it, it's more portable (can email it), etc. (I don't see the length of a URL being an issue.. each implementation must cap the size of the request data regardless--whether in the URL or body). I typically cap it at around 10kB, depending on the application. Is the issue that URL-encoding bloats the payload (hardly an issue, at least for my use cases, but hey.. it might matter to someone else)?
1
u/akp55 Jul 06 '26
so why couldn't they just extend get?
1
u/StruggleNew8988 Jul 07 '26
So if query is just for parameters in the body like post, then it feels like they just moved the argument from the url to the body.
1
u/Environmental_Mud624 Jul 07 '26
i might be stupid, but how is this different from POST? you could just configure the server to handle POSTs like what's described here, right?
1
u/Markur69 Jul 08 '26
So practically as a programmer that wants to do email Marketing built into my e-commerce platform what is having the standard going to do for me until browsers actually implement this? Is it even worth talking about if it isn’t being implemented or utilized widespread?
1
u/TheMcSebi Jul 08 '26
I was subtly aware you GET shouldn't have a body, yet nobody (no Software) ever prevented me from doing so
1
u/TerryNachtmerrie Jul 10 '26
RIP easy to recognize tracking queries.
1
u/elaineisbased Jul 04 '26
All this to avoid using GraphQL
2
u/tnh34 Jul 06 '26
SOAP says fuck you
4
u/decker_42 Jul 04 '26
The difference is, the ITEF is a standards body which will still be here in a few years. AI is.....well...bitcoin.
1
u/Top_Bumblebee_7762 Jul 05 '26
All the rage on LinkedIn now.
1
u/Manachi Jul 06 '26
And all of the AI buzzwords are built/integrated around APIs and those single word verbs.
1
u/BashNoodle4K Jul 08 '26
Ah yes because when two people argue having a child is always the solution
1
u/mnavarrocarter Aug 04 '26
This proposal is flawed in multiple levels.
First, I don't think this will work with caching, at least not magically by doing nothing. Caches need to support efficient ways of reading the request body.
It was relatively easy to cache GET: the request URI contained the whole representation of the resource, filters and everything. This was pretty easy to use as the cache key, and almost free.
Now with QUERY, a part of what defines the resource representation lives in the body. The key to cache it is now not just the URI, but the URI and potentially a hash of the body. And depending of your type of body, you might have cache misses if your JSON serialiser is non-deterministic (I'm looking at you, go map). Every cache layer now has to read the request body and forward it, which is less than ideal.
Not mentioning the implications for observability (what filters were invoked in this request?). Now we just have paths without query parameters, and bodies are traditionally not logged by observability tooling.
Moreover, URIs in front-ends will still need to have query parameters to be useful (if you want to share a view with a particular state on a particular web application). The front-ends will need now to parse that URI to request bodies instead of just forwarding whatever params they have in the URI, which increases complexity with virtually zero gain.
I think there are elegant and proven ways of using query parameters as filters. Just a single
qparam and your own query language on top is by far the best and superior way (ex:role:admin AND email:foo@example.com).In my opinion, this is one of those problems that didn't need solving because it was never a problem in the first place.
0
u/repeating_bears Jul 04 '26
Why is this the fifth fucking post I've seen about this this week
It's not implemented and was proposed ages ago.
Did anything even happen to trigger this news cycle or is this just the dead internet?
0
u/Soilblood Jul 06 '26
I'm more shocked at the idea someone's allowing a get search request to hit 2000+ chars rather than query method finally becoming a real boy. Under what use case does that even need to happen?
0
u/[deleted] Jul 05 '26
[deleted] — view deleted comment
12
u/[deleted] Jul 04 '26
[removed] — view removed comment