Skip to content

Add first-class HTTP QUERY method (RFC 10008)#896

Merged
benoitc merged 1 commit into
masterfrom
feature/query-method
Jul 4, 2026
Merged

Add first-class HTTP QUERY method (RFC 10008)#896
benoitc merged 1 commit into
masterfrom
feature/query-method

Conversation

@benoitc

@benoitc benoitc commented Jul 4, 2026

Copy link
Copy Markdown
Owner

QUERY (RFC 10008) is a safe, idempotent method that carries a request body, intended for read-only operations too large or sensitive for a URL. This adds it as a first-class method: hackney:query/1..4 are generated from the method template and delegate to hackney:request(query, ...), and hackney_h3 gets an explicit QUERY mapping alongside the other methods. No other logic was needed since hackney has no method whitelist and body handling is method-agnostic, so every body mode (binary, streamed, async, connection API) works unchanged and the wire method is always QUERY with no fallback to POST.

Tests in test/hackney_query_tests.erl assert the wire method against local servers on all three protocols: cowboy for HTTP/1.1 (helper arities, generic request, JSON body, streamed body, async, connection API), a local h2 TLS server echoing the received :method, and a local in-process quic_h3 server that only answers 200 to QUERY, covering both hackney_h3:request and the full hackney:request stack over HTTP/3. README and the HTTP guide document the method, and the version moves to 4.5.0 with a NEWS entry.

QUERY is safe and idempotent and carries a request body like POST.
Generate hackney:query/1..4 from the method template, add the explicit
h3 method mapping, and document the method in the README and HTTP
guide. Tests cover h1, h2, and h3 against local servers that echo the
wire method, including a local in-process quic_h3 server. Bump to
4.5.0.
@benoitc benoitc merged commit 50b2691 into master Jul 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant