One advantage of GET is I can just copy the URL and share it. The article makes no mention of that. While I love the proposal (apart from the name, I can see the SEARCH verb being used for something that's not search), they should also address the URL share-ablity aspect. Something like " rel="nofollow">https://google.com/search where query can be arbitrarily large (>2000 URL length restriction) and the browser is sm…
Defining a new HTTP method: HTTP Search (2021)
111–120 of 131 posts
Re: Defining a new HTTP method: HTTP Search (2021)
#112Earlier quoted context omitted.
So can POST. It's entirely redundant
Verbs specify safety/idempotency guarantees for API-blind middleware, as well as whether (if either applies) a body needs taken into account; POST is not idempotent, SEARCH/QUERY is safe, and therefore also idempotent, but differs from GET in that that guarantee is body-specific.
Re: Defining a new HTTP method: HTTP Search (2021)
#113Earlier quoted context omitted.
SEARCH can have a request body. Many systems limit the length of the URL, so this is significant.
If I send a request body with GET, what modern systems would even have a problem with that? Is there some caching middleware somewhere that I've never heard of or just ignored that will screw it up? If there was a GET-with-body http verb I'd probably use it at one point or another, but I often wonder where plain GET would start blowing up if I just used it for that. Honestly, I think rest is a mess, and that everythi…
Re: Defining a new HTTP method: HTTP Search (2021)
#114Earlier quoted context omitted.
SEARCH can have a request body. Many systems limit the length of the URL, so this is significant.
If I send a request body with GET, what modern systems would even have a problem with that? Is there some caching middleware somewhere that I've never heard of or just ignored that will screw it up? If there was a GET-with-body http verb I'd probably use it at one point or another, but I often wonder where plain GET would start blowing up if I just used it for that. Honestly, I think rest is a mess, and that everythi…
Re: Defining a new HTTP method: HTTP Search (2021)
#115One advantage of GET is I can just copy the URL and share it. The article makes no mention of that. While I love the proposal (apart from the name, I can see the SEARCH verb being used for something that's not search), they should also address the URL share-ablity aspect. Something like " rel="nofollow">https://google.com/search where query can be arbitrarily large (>2000 URL length restriction) and the browser is sm…
Re: Defining a new HTTP method: HTTP Search (2021)
#116Earlier quoted context omitted.
That's not as much as you might think. There's a reason elasticsearch accepts POST
But what exactly is the difference between POST and SEARCH? Both include the request parameters in the body, so they would be obscured from the user. Unless they aren't, in which case it is a matter of the choices made in the implementation. Is it implied idempotency and the lack of a confirmation dialog when the user reloads the page?
Re: Defining a new HTTP method: HTTP Search (2021)
#117Earlier quoted context omitted.
Verbs specify safety/idempotency guarantees for API-blind middleware, as well as whether (if either applies) a body needs taken into account; POST is not idempotent, SEARCH/QUERY is safe, and therefore also idempotent, but differs from GET in that that guarantee is body-specific.
Might as well just say "ok now GET can have body" instead of all that noise
(Of course, you could instead bump the HTTP version for support of GET-with-body, but given how HTTP/2 and HTTP/3 are defined in terms of HTTP/1.1, you’d need three new versions of HTTP for a change to core verb semantics. A new verb, again, is far simpler.)
Re: Defining a new HTTP method: HTTP Search (2021)
#118This seems reasonable, but unlikely to happen. GET is already pretty much sufficient, especially given that clients generally support megabytes worth of query strings in these modern times. If we're doing this though, I'll cast my vote for naming it more semantically as QUERY, and forgoing whatever little WebDAV compatibility would be had otherwise.
I’ve, amazingly, managed to hit the arbitrary megabyte limit in real production software.
Re: Defining a new HTTP method: HTTP Search (2021)
#119I’d like to see this (or something like it) ship. Right now the two most common alternatives are: 1) GET, but base64 encode a json payload as a query param. Main downsides are that you can hit URL size limits, it makes the client and server slightly more complex (base64 encode/decode), and it sucks with browser dev tools - can’t nicely inspect the request in the browser, have to copy and decode it 2) Use POST to sear…
I would say that people should be more open to using HTTP in non-REST ways. Sometimes you want to send a request and receive a response, with arbirtrary restrictions and side effects that suit your cases. There are a lot of good reason for rest to exists, but also sometime you want to POST /open-garage-door?t=5-minutes and call it a day