Live data from Hacker News

Upcoming new HTTP QUERY method

datatracker.ietf.org

11–20 of 79 posts

Re: Upcoming new HTTP QUERY method

#11

The spec doesn't say how browsers should represent such request in the browser address bar. The nice thing with GET is that you can copy a search url, bookmark it or share it with someone, and they get back the exact same results. How would that work with a QUERY method?

same as with POST: not really intended for that case.

Re: Upcoming new HTTP QUERY method

#12
Two things that come to my mind:

- why not just extend GET to make a payload not "undefined" anymore? Instead now people have to wonder whether to use GET or QUERY. The non-idempotent methods have at least a difference in semantics, while this here seems mostly another way to provide parameters for essentially the same action.

- QUERY is a somewhat bad name choice, given that URL parameters are also refered to as query string

Re: Upcoming new HTTP QUERY method

#13
post #6

Is GET with a request body impractical at this point? It has historically been frowned upon [1] but is it really too late to change that convention? [1]: https://stackoverflow.com/questions/978061/http-get-with-req...

I've seen this done a few times and in most of those cases I agreed it made sense. I've thought about this myself a few times too.

But it does lead to unexpected behavior. Users are trained to copy/paste links and send them. If the body only included stuff like auth tokens then it would be ok, but if relevant query stuff was in there (like page size, for example) that would lead to different results that would ultimately be deleterious IMHO.

Re: Upcoming new HTTP QUERY method

#15
Is it really OK to add a new method to HTTP 1.1? I think would be quite an unfortunate decision, because it would make the version numbers absolutely meaningless if all of a sudden new methods can pop up without them changing.

Re: Upcoming new HTTP QUERY method

#16

The spec doesn't say how browsers should represent such request in the browser address bar. The nice thing with GET is that you can copy a search url, bookmark it or share it with someone, and they get back the exact same results. How would that work with a QUERY method?

probably same as with POST, that is not at all

Re: Upcoming new HTTP QUERY method

#17
Interesting that they use an sql-like query in the examples.

I hope this does not mean that this will be taken as the default method of querying.. A JSON query object could've been nice as an example.

How should you handle conflicting parameters (form-encoded + body)?

Also, on the HTML side.. If it's extended to .. how will you be able to distinguish between the query part and the uri part?

How can/should you copy/share links? Will browsers simply base64 encode this somewhere?

Re: Upcoming new HTTP QUERY method

#18

The spec doesn't say how browsers should represent such request in the browser address bar. The nice thing with GET is that you can copy a search url, bookmark it or share it with someone, and they get back the exact same results. How would that work with a QUERY method?

The browser address bar performs GET requests, so I think the answer is "you can't bookmark or share QUERY requests," same as with POST requests.

However, just as with POST requests, it might make sense for the server to respond with a redirect to a URL that could be shared.

Re: Upcoming new HTTP QUERY method

#19

Two things that come to my mind: - why not just extend GET to make a payload not "undefined" anymore? Instead now people have to wonder whether to use GET or QUERY. The non-idempotent methods have at least a difference in semantics, while this here seems mostly another way to provide parameters for essentially the same action. - QUERY is a somewhat bad name choice, given that URL parameters are also refered to as que…

I think this was a situation where either choice (extend GET, create QUERY) was less then ideal but at least if you create a new namespace in QUERY you can avoid arcane business logic around GET by various caches, loadbalancers, proxies, and other software that made who knows what terrible assumptions around GET payload shape.

Re: Upcoming new HTTP QUERY method

#20

Two things that come to my mind: - why not just extend GET to make a payload not "undefined" anymore? Instead now people have to wonder whether to use GET or QUERY. The non-idempotent methods have at least a difference in semantics, while this here seems mostly another way to provide parameters for essentially the same action. - QUERY is a somewhat bad name choice, given that URL parameters are also refered to as que…

[deleted]
Post reply on HN