News for hackers. Stuff that matters.
Re:RFC 10008: The new HTTP Query Method by CodesInChaos on Wednesday June 17, 2026 @08:27AM (#48569436)
I wonder if HTML forms will add support for QUERY:

    <form action="..." method="query">
This would avoid the annoying re-submission warnings you're getting if you refresh a page that was returned by a POST form submission, since QUERY is required to be idempotent.
Re:RFC 10008: The new HTTP Query Method by bob1029 on Wednesday June 17, 2026 @09:03AM (#48569934)
This is better solved with the post redirect get pattern.
Re:RFC 10008: The new HTTP Query Method by diroussel on Wednesday June 17, 2026 @12:49PM (#48573081)
That is the good old fashion workaround. But why is it better than a form causing an HTTP QUERY.

If we can do QUERY forms, it would be an ideal time to add JSON encoding for forms.

Re:RFC 10008: The new HTTP Query Method by CodesInChaos on Wednesday June 17, 2026 @03:05PM (#48575195)
The redirect pattern makes sense for a POST request that creates a resource, where you can then redirect to the newly created resource.

QUERY on the other hand makes sense for cases where the request doesn't cause any state changes on the server, and there is no resource to redirect to.

Re:RFC 10008: The new HTTP Query Method by amluto on Wednesday June 17, 2026 @10:39AM (#48571191)
One oddity of forms: the result of a form POST is a page that has a location (the URL) but that cannot loaded via that location. As far as I know, the fact that the page is a POST and not a GET is not stored anywhere visible to the user or to JS. And refresh works oddly.

If method=QUERY were added, there would be a new variety of this weirdness.

Re:RFC 10008: The new HTTP Query Method by sheept on Wednesday June 17, 2026 @11:22AM (#48571743)
At least browsers wouldn't have to warn users that they'd be resubmitting data if they reload the page after submitting a query form, since query requests are intended to be idempotent
Re:RFC 10008: The new HTTP Query Method by amluto on Wednesday June 17, 2026 @11:47AM (#48572131)
You still get the nastiness that the Sec-Fetch-* state gets mostly trashed when you hit refresh. And someone would need to figure out how CORS preflight interacts with refresh, which is not currently an issue with POST. (The current "simple request" behavior or whatever it's called is a real mess and is the cause of a lot of CSRF vulnerabilities.)
Re:RFC 10008: The new HTTP Query Method by tempfile on Wednesday June 17, 2026 @09:20AM (#48570158)
Depends whether your form submission should expect side effects or not. Most forms submissions have side effects. If the effect is truly idempotent, wouldn't PUT be a better verb? That is also supposed to be idempotent.
Re:RFC 10008: The new HTTP Query Method by echoangle on Wednesday June 17, 2026 @10:29AM (#48571058)
You can’t use PUT as a form action though.
Re:RFC 10008: The new HTTP Query Method by tempfile on Thursday June 18, 2026 @05:01AM (#48582754)
I always forget this, because it makes no sense. Fair enough!
Re:RFC 10008: The new HTTP Query Method by diroussel on Wednesday June 17, 2026 @12:52PM (#48573117)
GET and QUERY are both idempotent.
Re:RFC 10008: The new HTTP Query Method by mring33621 on Wednesday June 17, 2026 @04:11PM (#48576157)
Hold my beer!
Re:RFC 10008: The new HTTP Query Method by tempfile on Thursday June 18, 2026 @04:54AM (#48582704)
I know, but neither GET nor QUERY may have side effects.
Re:RFC 10008: The new HTTP Query Method by 100ms on Wednesday June 17, 2026 @08:32AM (#48569513)
Forms, HTTP implementations, public API surfaces, and all for what exactly. Introducing a new verb for this feels profoundly misplaced
Re:RFC 10008: The new HTTP Query Method by jagged-chisel on Wednesday June 17, 2026 @08:49AM (#48569746)
Idempotency is an important attribute for correctness. Yep, you can document that POSTing to $ENDPOINT is idempotent, but you can't communicate that to caching layers throughout the network. QUERY, by definition, is idempotent and cacheable.
Re:RFC 10008: The new HTTP Query Method by resters on Wednesday June 17, 2026 @12:15PM (#48572572)
Great point. I wish more people realized that intuitively.
Re:RFC 10008: The new HTTP Query Method by jnewton_dev on Wednesday June 17, 2026 @09:02AM (#48569907)
Does anyone know if this approach works at significantly larger scales? Curious about where it breaks down.
Re:RFC 10008: The new HTTP Query Method by inigyou on Wednesday June 17, 2026 @10:06AM (#48570769)
Larger scales like what? I expect that everywhere you currently cache GETs you can cache QUERYs. But does caching GETs work at scale?
Re:RFC 10008: The new HTTP Query Method by alpinisme on Wednesday June 17, 2026 @08:51AM (#48569758)
At least support - or lack thereof - for a new verb is unambiguous (compared to changing the semantics of GET)
Re:RFC 10008: The new HTTP Query Method by ctdinjeu7 on Wednesday June 17, 2026 @08:41AM (#48569640)
Now HN’s UX can finally be decent.

The team will have to wait for a new header and textarea specs to fix the rest of the jank.

This site is so awful lol. Why don’t they update it?

Re:RFC 10008: The new HTTP Query Method by CodesInChaos on Wednesday June 17, 2026 @08:46AM (#48569697)
Where does HN use POST for safe operations? I can't think of any.

Comment submission isn't safe, so QUERY can't be used there. And it doesn't suffer from the problem anyways, since HN returns a 3XX on successful submission, so refreshing doesn't show a warning.

Re:RFC 10008: The new HTTP Query Method by acabal on Wednesday June 17, 2026 @12:44PM (#48573015)
Supporting more than GET/POST in HTML forms has been my dream for decades. There's a WHATWG proposal to do just that if you want to add your voice: https://github.com/whatwg/html/pull/11347
Re:RFC 10008: The new HTTP Query Method by MBCook on Wednesday June 17, 2026 @03:38PM (#48575703)
What’s the use case for that?
Re:RFC 10008: The new HTTP Query Method by acabal on Wednesday June 17, 2026 @07:28PM (#48578471)
Because if HTTP is the language of the web, then HTML forms are how humans speak that language to computers. Right now we humans can only speak GET and POST.

In other words, right now if a human wants to DELETE a widget, the human has click on an HTML form to `POST /widgets/123/delete`, or use some other workaround like smuggling a special `_method=DELETE` variable. This is unnatural and semantically incorrect, resulting in ugly hacks that break HTTP-level expectations like idempotency; and it also requires additional app-level logic to process.

Meanwhile a machine is allowed to simply `DELETE /widgets/123` because their interface to HTTP is not clicking on HTML forms.

We humans could converse with websites in semantically correct HTTP, have clean URLs in which both REST APIs and human-facing URLs are identical without hacks, and require no extra app/framework logic, if HTML forms simply allowed all (human-relevant) HTTP verbs.

Re:RFC 10008: The new HTTP Query Method by imtringued on Thursday June 18, 2026 @06:10AM (#48583223)
Things like that are why it's completely unreasonable to expect websites to work without first party Javascript. Utterly basic and mundane functionality is gated behind Javascript.

Building the mundane in the absence of JavaScript isn't some small thing you can build. It's going to require you to rebuild your entire site around the idea. Things like a searchable dropdown will now turn a single page form into a horrifying multi page mess where you get sent to a page for just the dropdown and the search box and selectable options, which then send you back to the original form. That is going to require you to store a lot of the form data on the server to keep track of what you entered across pages rather than let the browser do its thing.

The noscript crowd should have lobbied for a better HTML instead of rallying against JavaScript.

Re:RFC 10008: The new HTTP Query Method by Balthild on Thursday June 18, 2026 @10:21PM (#48594156)
It is almost a use case in itself: to make an form in pure HTML to allow user to update/delete a resource on the server, without violating the HTTP semantics with routes like `POST /items/:id/delete`.
Re:RFC 10008: The new HTTP Query Method by lenkite on Saturday June 20, 2026 @06:43AM (#48608184)
I don't want to write Javascript for what should be a core feature of Basic HTML forms.
Re:RFC 10008: The new HTTP Query Method by CodesInChaos on Wednesday June 17, 2026 @05:04PM (#48576889)
I'm not convinced of the benefit of allowing PUT/PATCH/DELETE in forms. But QUERY sounds more useful, and its lack of side-effects (plus the lack of legacy code using it) would avoid the need for CORS preflight requests.

There is a separate issue for QUERY: https://github.com/whatwg/html/issues/12594

Re:RFC 10008: The new HTTP Query Method by chrismorgan on Wednesday June 17, 2026 @01:08PM (#48573344)
Re:RFC 10008: The new HTTP Query Method by paradox460 on Wednesday June 17, 2026 @02:23PM (#48574517)
They never added support for any other verbs, but it's a brave new world, so who knows
Re:RFC 10008: The new HTTP Query Method by XYen0n on Thursday June 18, 2026 @01:52AM (#48581329)
If new method support is added, PUT should be used in this scenario.
Re:RFC 10008: The new HTTP Query Method by conorcleary on Thursday June 18, 2026 @01:23PM (#48588594)
We do already have CALL