You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add query() route method for the HTTP QUERY verb (RFC 10008)
The HTTP QUERY method was recently published as RFC 10008 on the
IETF Standards Track. It is a safe, cacheable method that carries
its query in the request body, enabling expressive queries without
the URL-length and cacheability trade-offs of GET vs. POST.
Support for QUERY is landing across the ecosystem
(https://www.rfc-editor.org/rfc/rfc10008), so this adds a query()
helper as a sibling of the existing get()/post()/put()/patch()/
delete()/options() route methods on RouteCollectorProxyInter
implemented via the existing map() mechanism:
```
$app->query('/search', function (Request $request, Response $response) {
$criteria = (string) $request->getBody();
// ...run the query described in the request body...
return $response;
});
```
`$app->query()` is equivalent to `$app->map(['QUERY'], ...)` and is not added to any(), so existing any() routes are unaffected.
0 commit comments