
HTTP QUERY: the search endpoint you fake with POST
TL;DR: I think QUERY is the honest replacement for the POST /search endpoint. It is a new HTTP method for reads that need a body, and it is safe, idempotent and cacheable. I’d try it on new internal APIs, but check every hop first, because several gateways, WAFs and CDNs reject it today.
Picture a product list with filters: categories, a price range, a few attributes and a sort order. The filter outgrows the URL, so someone adds POST /search. It creates nothing, but it’s still a POST.
Then a mobile client times out on it. The HTTP library won’t retry a POST on its own, the CDN never caches it, and the dashboard counts it as a write. Nothing is broken, yet everything around the endpoint treats a read as a write, and we pay for that in small ways.
What QUERY changes
RFC 10008 came out in June 2026. QUERY works like POST in one way: the filter travels in the body, and the Content-Type says how to read it. It makes the same promises as GET. It is safe and idempotent, so a client may retry it and a cache may store the answer.
A missing or inconsistent Content-Type must fail, usually with 400 or 415. The server can list the formats it takes in an Accept-Query header. Results can also get an address. Content-Location points to a resource where a GET returns the results just computed, and Location points to an equivalent resource you can GET without a body. I like that. It’s a link you can share.
Caching is the tricky bit, in my view. The RFC says the cache key must include the body and the media type. A cache may normalise the body for the key, but the RFC gives no algorithm and warns that wrong normalisation causes false hits. So two JSON bodies with a different key order may still count as two requests.
On the PHP side, HttpFoundation has known QUERY since Symfony 7.4. Request::isMethodSafe(), isMethodIdempotent() and isMethodCacheable() all return true for it. The CachingHttpClient support was merged on 2026-08-13 and is coming in Symfony 8.2. The plan is November 2026. Its key is the method, the URL, the body and the Content-Type, and a QUERY without a Content-Type is not cached.
A route with methods: ['QUERY'] matches by a plain string compare. Method override can only turn a real POST into QUERY, and only with the override header or _method switched on.
GET, POST /search or QUERY
I’d keep GET while the filter fits in the URL. It works everywhere, you can bookmark it, and every cache knows it. The downside is real, though. URLs have length limits, and filters in a URL end up in access logs, which matters if the filter holds an email address.
The POST /search endpoint works on almost every proxy, but its cost is the semantics. Clients and proxies have no reason to retry it, and POST responses aren’t cached by default. Some HTTP clients retry a POST anyway, so the behaviour is probably a bit random.
QUERY has the right semantics and the biggest unknown. For a new internal API where you own both ends, QUERY is my pick. A public API behind a CDN you don’t control is different. There I’d wait, or offer both, and keep POST /search alive as a fallback. To me that’s ugly, but it’s cheap.
Audit before production
Each hop that sees the request can break it. For some products I have facts, and for others I have nothing, so those lines say check it yourself.
- Gateway and proxy. The picture is mixed. Envoy before 1.40 rejected QUERY on HTTP/1 with a 400, and since 1.40.0 (October 2026) it forwards it. Apache 2.4.52 forwarded the method and body in one local test. nginx accepts the method name, but QUERY isn’t allowed in
limit_exceptorproxy_cache_methods, and body forwarding is unverified. HAProxy and Traefik docs say they don’t reject unknown methods, but nobody tested it. Kong is unclear. AWS API Gateway doesn’t support QUERY as a method. - WAF. The OWASP Core Rule Set allows GET, HEAD, POST and OPTIONS by default, and rule 911100 blocks QUERY at the first paranoia level. Azure WAF includes that rule, but its method list isn’t documented. For plain ModSecurity, AWS WAF and Cloudflare WAF, check it yourself.
- CDN. CloudFront has QUERY in no allowed-method set and never caches it. Fastly passes it but doesn’t cache it, and forcing a cache lookup turns it into a GET and drops the body. Akamai answers 501 by default for anything except GET, HEAD and OPTIONS. For Cloudflare, check it yourself. No CDN is known to cache QUERY by its body, so I’d plan without CDN caching.
- CORS. QUERY isn’t CORS-safelisted, so a browser sends a preflight, and the server must list QUERY in Access-Control-Allow-Methods. Also, fetch does not uppercase a lowercase “query”, so write it in capitals.
- CSRF. Safe doesn’t mean skipped. In Symfony
#[IsCsrfTokenValid]checks every method unless you setmethods. Django checks QUERY too, while Rails main exempts a real QUERY and still checks a POST with_method=query. Test your own stack. - OpenAPI. Version 3.2.0 adds
queryto the Path Item object. Version 3.1.x has no place for it, so tools on 3.1 can’t describe the endpoint.
I’d run all six in a staging environment with the same gateway and CDN as production. A local curl test says nothing about the hops in between.
Have you put a QUERY endpoint behind a CDN yet? What broke first?


