Repository navigation
Missing HTTP verb: QUERY #60564
Laravel Version13.8.0 PHP Version8.5.7 Database Driver & VersionN/A DescriptionThe HTTP https://www.rfc-editor.org/info/rfc10008/
To summarize the RFC, the Currently, Laravel does not have any way to make use of this HTTP verb. This is a problem. Given that this RFC is new, it may be desirable to add support to the Steps To ReproduceN/A |
Replies: 12 comments 2 replies
|
That link is a proposal, right? Are there any frameworks, in any programming language, implementing it already? Also, are there any server runtimes (Node.js, Python, etc.) that support it already? |
You can: public function get($uri, $action = null)
{
return $this->addRoute(['GET', 'HEAD'], $uri, $action);
}framework/src/Illuminate/Routing/Router.php Line 158 in 4f65316 You can Write Route::addRoute(['QUERY', 'HEAD'], '/example', .... |
|
@rodrigopedra |
|
Symfony added support to it just to its HTTP Client component, the one that wraps curl. On their Http Foundation they added a constant to a class, but nothing more, no routing support, no body parsing, no checks for idempontency, at least not yet as of today. If I understand well, Maravel is your fork from Laravel with patches that didn't make the cut on PRs here and other changes you deemed important, right? It is great that you add experimental features to your fork, but adding a feature is a kind of maintenance compromise on the long run, adding support to proposals not yet made official is a tricky decision on this regard. Out of curiosity, isn't your fork's name ("Maravel") close enough to Laravel to infringe its trademark? I am not a lawyer, and I believe as long it is a personal fork there souldn't be a problem. But when you start promoting it as an alternative framework, as you do here listing it as an example of this feature being adopted, I guess it could be a trademark infringement. |
|
There are different HTTP verbs, depending on what you are doing (e.g. WebDAV has Since
|
|
@marius-ciclistu no worries, I thought on bringing this matter to attention not to push you back from working on Maravel, but to maybe considering any risks on your continued effort. I am neither a maintainer nor a trademark expert or attorney. So please take my words lightly and not as a criticism. |
|
It's disappointing that this got moved to the discussion channel while I was unavailable, but given that indeed Laravel has e.g. Given the vast volume of discussion topics being created and commented on, I can imagine this topic is gonna be forgotten and no support for the QUERY verb will be added. Would be lucky if we can use I consider the proposed |
|
For anyone following this: QUERY support is now actively moving in PRs.
Worth noting since it came up above: as of Symfony 7.4 (Laravel 13's minimum), HttpFoundation supports QUERY beyond just a constant, Request::create() places parameters in the request body like POST/PUT/DELETE, and Request::createFromGlobals() parses QUERY request bodies. And QUERY is no longer a draft, it was published as RFC 10008 on the Standards Track. |
|
I cannot imagine trying to explain this to my grandchildren. Look, we had a GET method, but we kept ignoring the body/payload so we created a new method QUERY which does the same thing as GET but this time we do not ignore the body. Oh boy.. |
|
Until there's first-class support, you can register it yourself — Route::match(['QUERY'], '/search', SearchController::class);It isn't matched by Two caveats I hit: Symfony doesn't populate the — |
|
I myself was initially confused by this situation; there is ambiguity when it comes to the wording. The thread was converted from an Issue so the timeline is unusual for a Discussion. There is also interest to review the situation after all these time. HTTP QUERY was previously published as RFC 10008. There are three types of "HTTP QUERY support":
To summarize the situation by time line:
Great help by @shanerbaner82 for clarifying the situation and presenting the initial PRs #60564 (comment) . Also good catch to backport HTTP QUERY receipients #60564 (comment) . For older Laravel versions (do upgrade asap regardless), we may still use
The situation for HTTP QUERY support in Laravel should then be well-addressed. |
I myself was initially confused by this situation; there is ambiguity when it comes to the wording. The thread was converted from an Issue so the timeline is unusual for a Discussion. There is also interest to review the situation after all these time.
HTTP QUERY was previously published as RFC 10008.
There are three types of "HTTP QUERY support":
HttpfacadeTo summarize the situation by time line: