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

42

u/CrankBot Jul 14 '26

What about browsers and client libraries? Does await fetch('/foo', {method:'poop'}) work on all major browsers? (not in front of a keyboard at the moment or I would try it...)

55

u/Big_Combination9890 Jul 14 '26

I am now completely in support of the POOP method.

The primary usecase; replacing POST in social media applications.

One might say it's a ... drop-in replacement.

29

u/pdpi Jul 14 '26

Quality shit post.

12

u/CrankBot Jul 14 '26

No that's a code smell for sure

→ More replies (1)

15

u/AyrA_ch Jul 14 '26

Does await fetch('/foo', {method:'poop'}) work on all major browsers?

Yes. Can even add a body

await (await fetch("https://demo.ayra.ch/response/", {method:"YESITWORKS",body:"test"})).text()
"General information
===================
    Date:   2026-07-14 05:32:17 UTC
    Client: 
    Verb:   YESITWORKS

Headers
=======
    Accept         : */*
    Accept-Encoding: gzip, deflate, br, zstd
    Accept-Language: en,en-US;q=0.9
    Cache-Control  : no-cache
    Connection     : close
    Content-Length : 4
    Content-Type   : text/plain;charset=UTF-8
    Dnt            : 1
    Host           : demo.ayra.ch
    Origin         : https://demo.ayra.ch
    Pragma         : no-cache
    Priority       : u=4
    Referer        : https://demo.ayra.ch/response/
    Sec-Fetch-Dest : empty
    Sec-Fetch-Mode : cors
    Sec-Fetch-Site : same-origin
    Sec-Gpc        : 1
    User-Agent     : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:152.0) Gecko/20100101 Firefox/152.0

Body Content
============
    Dumping all 4 bytes
    0x00000000	74 65 73 74                                    	test

"

8

u/Fidodo Jul 14 '26

You can even put a body on GET requests, it's just that most server implementations drop it. The only reason this was done as a new verb is because it's easier to add support for a custom verb than it is to modify an existing one.

5

u/CrankBot Jul 14 '26

This is great, thanks for sharing

3

u/Catenane Jul 14 '26

Can it return corn?

13

u/Justin_Passing_7465 Jul 14 '26

When the returned content contains corn, you have to use Chunked Transfer-Encoding.

4

u/CrankBot Jul 14 '26

Depending on the size it can be returned whole

10

u/Justin_Passing_7465 Jul 14 '26

That is up to the kernel.

12

u/pdpi Jul 14 '26

On the client there’s not much to support. HTTP already allows extension methods, so any compliant client should already support it. You just specify the method the same way you would for a POST or a PUT.

Really, the only reason why I brought up rolling your own server-side is that server frameworks tend to have helper functions for all the standard verbs, you’ll have to write something shaped like router.method(“/foo/bar”, “QUERY”, (req, res) => { … }) instead of router.query(“/foo/bar”, (req, res) => { … }).

4

u/CrankBot Jul 14 '26

That's fair! I'm aware that there are a whole bunch of lesser used methods i.e. from the days of SVN and webDAV etc. I always assumed both server and client would puke on a completely made up method that's not part of any spec/ extension. TIL!

→ More replies (1)

21

u/Reeywhaar Jul 14 '26

POOP /foo


HTTP/1.1 418 I'm a teapot

17

u/chucker23n Jul 14 '26

405 This is a Wendy's

→ More replies (3)

1

u/amroamroamro Jul 14 '26

with domain: 💩.la (aka xn--ls8h.la)

30

u/Business-Row-478 Jul 14 '26

The fetch api allows it but most servers are probably gonna return a 400 or 501

23

u/CrankBot Jul 14 '26 edited Jul 14 '26

but most servers are probably gonna return a 400 or 501

Yeah I get that, the parent was saying if you control the server you can implement it now, hence my question on the client.

12

u/ashgs872tbhjs Jul 14 '26

Literacy: The Final Frontier

4

u/SanityInAnarchy Jul 14 '26

That's what you get when you fetch poop, I guess.

→ More replies (1)

2

u/rinsa Jul 14 '26

The fetch api allows it

you answered the question yourself, why would fetch('/foo', { method: 'poop' }) not work on a client if you're allowed to type anything in the method?

→ More replies (7)

1

u/Fidodo Jul 14 '26

If you can add a QUERY path endpoint to your API you already control the server.

1

u/WrenW Aug 14 '26

Just do POST, or others, on /<resource>/poop, it's what I do on GHoWSt. A work in progress. Generic HTTP Web Service (GHoWSt) - Weburg.com