HTTP QUERY method builder

Enter an endpoint, media type and query body to generate examples, or inspect a pasted HTTP/1.1 request. Nothing is sent to the endpoint.

Generate request examples without making a network request. JavaScript is required.

How it works

RFC 10008 defines QUERY as safe and idempotent. Its Content-Type must describe the query body; the endpoint defines the actual query semantics. The builder writes an HTTP/1.1 request and illustrative POSIX-shell curl and JavaScript Fetch code. It counts UTF-8 bytes for Content-Length, without rounding.

Accept-Query is response metadata using a Structured Field List, not an Accept-style weighted list. Supply the value without the header name. The checker compares media ranges and supplied parameters, and parses JSON bodies when a JSON media type is declared.

The inspector accepts origin-form HTTP/1.1 requests, with LF or CRLF line separators. It checks visible framing but does not decode Transfer-Encoding, validate other query languages, or prove endpoint safety, support, caching or CORS. Host authority syntax and final chunked framing are checked before decoding is marked unassessed. A chunked body should be decoded separately. Generated text supports only UTF-8 charset declarations. Inputs are limited to 500,000 UTF-8 bytes and 10,000 lines; header blocks to 100,000 bytes and 1,000 lines. These are application limits.

Worked examples

UTF-8 body length

The JSON body {"q":"café"} occupies 13 UTF-8 bytes. The builder sets Content-Length: 13. With Content-Type: application/json and the same advertised format, the report has 0 visible issues.

Missing query media type

A QUERY /search HTTP/1.1 request with Host, Content-Length: 2 and body {}, but without Content-Type, has 1 visible issue. The server must reject missing media-type metadata.

Frequently asked questions

Does QUERY work automatically on my server?
No. The server and intermediaries must support the method, and the endpoint must define its query language. The generated code is an example, not a connectivity test.
Where should Accept-Query go?
In a response. It advertises accepted query media types. The request uses Content-Type for its input format; Accept, if supplied, describes desired output formats.
Can I use q=0.8 in Accept-Query?
Not as an Accept-style preference weight. Accept-Query parameters represent media-type parameters and must use Structured Field Token or String values. A numeric q weight fails that syntax.
What is the difference between Location and Content-Location?
For QUERY, Location can identify a resource that repeats the query. Content-Location can identify the returned result. Either resource can be temporary.
Will browser Fetch require preflight?
A cross-origin QUERY request requires CORS preflight. A pasted request cannot establish whether the server permits it. Bodies may still be logged even though the query is outside the URL.

Sources

Last reviewed 2026-11-14; next review due by 2027-02-12. The method is written out above so you can check our math.