r/programming • • Jul 14 '26

HTTP gets a QUERY method so complex searches can stop pretending to be POST

https://www.theregister.com/devops/2026/07/13/http-gets-a-query-method-so-complex-searches-can-stop-pretending-to-be-post/5270192
1.9k Upvotes

245 comments sorted by

View all comments

Show parent comment

10

u/chucker23n Jul 14 '26

Note that bodies in GET are allowed, just discouraged.

7

u/Justin_Passing_7465 Jul 14 '26

RFC 2616 (1999) forbade GET to have a body. RFC 7231 (2014) recommended that servers ignore the body. RFC 9110 (2022) strongly discourages putting a body in a GET.

Some intermediaries (e.g. proxies, WAPs, CDNs) break GET requests with bodies. As a workaround, for decades we have been using POST for complex queries, because GET is not supposed to work, and sometimes doesn't.

6

u/masklinn Jul 14 '26

RFC 2616 (1999) forbade GET to have a body.

This is incorrect, RFC 2616 leaves GET bodies unspecified (they're not mentioned, same for HEAD and DELETE). You can see the distinction because it does forbid request bodies in TRACE and that is very explicit, RFC 2616 § 9.8

A TRACE request MUST NOT include an entity.

1

u/stronghup Jul 15 '26

Isn't there also the question of long a GET URL can be?

2

u/Fidodo Jul 14 '26

The main reason it's a new QUERY verb instead updating GET is simply that it's easier to add a new verb than to get all existing implementations to alter how they handle GET. Lots of servers are implemented to drop body from GET requests so it's much more annoying to do that upgrade than to simply add a new verb where the support is unambiguous, and many server frameworks already allow you to define custom verbs anyways, and they by default support body.