
In June 2026, the HTTP QUERY method became an official standard, solving a long-standing problem in REST APIs. Learn why developers relied on POST for complex searches, how QUERY fixes it, and how to implement it in Express, FastAPI, and JavaScript.
If you've ever built a REST API, you've probably done this:
It worked, but it was never semantically correct.
In June , 2026 , a new HTTP method was standardized , that solved a 16 years old problem among developers.
Previously, there were this REST api methods : GET,POST,PATCH,PUT,DELETE
Last time PATCH was introduced in 2010.
1990s : GET, POST, PUT, DELETE become core HTTP methods
↓
1999 : GET / POST (publication of HTTP/1.1 (*RFC 2616))
↓
2010 : PATCH standardized (RFC 5789)
↓
2010–2026 : POST /search becomes the common workaround
↓
June 2026 : RFC 10008 introduces QUERY
To retrieve data we use GET:
GET /users/10
or
GET /users?dept=dev&page=2
But there is certain limitation.
GET:As an alternative for complex queries , developers previously used POST method.
In the body of the post method developers pass the queries which are resolved in the server side.
POSTLet's assume , we need to query a product . So, previously we use this way:
POST /products/search
Request body:
This is passed in the server through POST request.
Express server side:
app.post("/products/search", (req, res) => {
const filters = req.body;
// search database
res.json({
message: "Matching products",
filters });
});
This technique was Industry standard.But POST is intended to create resources or trigger actions. Searching dose not change server state , making it compromise more than a ideal choice.
You might wonder:
GET /products
{
...
}
Although the HTTP specification never explicitly forbids a GET request body, its semantics were never standardized. Many servers, proxies, and HTTP clients ignore or reject GET request bodies, making them unreliable in practice.

QUERY:The new QUERY method was introduced to solve exactly this problem.
It is:
*POST is not idempotent
QUERY /products/search
Content-Type: application/json
The server performs a search and returns matching products.
Nothing is created.
Nothing is updated.
Nothing is deleted.
QUERY in expressExpress doesn't yet have an app.query() method, but it can still handle custom HTTP methods.
import express from "express";
const app = express();
app.use(express.json());
app.(, {
(req. !== ) {
();
}
filters = req.; res.({
: req.,
filters,
:
});
});
const response = await fetch("/products/search", {
: ,
: {
:
},
: .({
: ,
: [, ],
: ,
:
})
});
data = response.();
.(data);
Since many AI services use FastAPI, here's how you can accept a QUERY request.
from fastapi import FastAPI, Request
app = FastAPI()
@app.api_route("/products/search", methods=["QUERY"])
async def search_products(request: Request):
filters = await request.json()
return {
"method": "QUERY",
"filters": filters
}
| Feature | GET | POST | QUERY |
|---|---|---|---|
| Reads data | ✅ | ✅ | ✅ |
| Create resources | ❌ | ✅ | ❌ |
| Idempotent | ✅ | ❌ | ✅ |
| Supports request body | ❌ | ✅ | ✅ |
| Safe | ✅ | ❌ | ✅ |
| Best for complex search | ❌ | Common workaround | ✅ |
Small search
↓
GET /products?page=2
Large search
↓
POST /products/search ← before 2026
Large search
↓
QUERY /products/search ← after RFC 10008
Although QUERY is now standardized, most frameworks, API gateways, reverse proxies, and API documentation tools are still adding support. For now, you'll continue to see POST /search in many production APIs.
*Notes:
Idempotent: An operation is idempotent if sending the same request multiple times produces the same final state.
GET, PUT, DELETE, and QUERY are idempotent.
PATCH may or may not be idempotent depending on how the server implements it.
POST is generally not idempotent.
RFC (Request for Comments): An RFC is an official technical document published by the Internet Engineering Task Force (IETF) that defines Internet standards and protocols. HTTP, TCP, TLS, and many other core Internet technologies are specified through RFCs. Once an RFC reaches the Internet Standard stage, it becomes an official standard that vendors and developers can implement.
References: