akka-http
akka-http copied to clipboard
Support for new HTTP QUERY method
There is a proposal for a new HTTP method called "QUERY", which looks like it should make it into an RFC relatively quickly since it should be rather uncontroversial:
https://www.ietf.org/archive/id/draft-ietf-httpbis-safe-method-w-body-02.html
We should probably monitor the progress of this document and implement QUERY as soon as other servers have done so (NGINX, Caddy, etc.).
The only thing to be careful about is the clear distinction between QUERY the HTTP method and Query the URI part. The name duplication here is unfortunate. In akka-http-core
proper separation is probably a bit easier than in the routing DSL.
a bit easier than in the routing DSL
We don't seem to have a query
directive, do you mean by introducing one, people could be misled? Maybe we could handle the QUERY with Content-Type: application/x-www-form-urlencoded
directly in the parameters
or formField
directive.
We don't seem to have a query directive, do you mean by introducing one, people could be misled?
Yes, so far we've simply given each (relevant) method it's own stand-alone directive with a name matching the method name in lower case. I don't know whether introducing a query
directive in the same way really is the best solution...
Maybe we could handle the QUERY with Content-Type: application/x-www-form-urlencoded directly in the parameters or formField directive.
Yes, and multipart/form-data
just the same.
I think it's great the HTTP will finally have proper solution for more complex "search query forms" that quite a few web sites provide. So far they mostly resort to POST requests which prevent browsers from simply repeating requests (e.g. after a click on the "reload" button), without these stupid "do you really want to resend the form" popups...