GeezerVison is showing github.com — Add HTTP QUERY method support (RFC 10008) by ewalsh · Pull Request #14072 · playframework/playframework
Conversation
ewalsh
commented
Jul 7, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Pull Request Checklist
Fixes
N/A (new feature)
Purpose
Add first-class support for the HTTP QUERY method as defined in RFC 10008.
The QUERY method is a safe, idempotent request method that carries a request body — combining the safety semantics of GET with the body-carrying capability of POST. It was published as a Proposed Standard in 2025 and addresses the long-standing need for content-bearing safe requests (e.g., complex search queries that exceed URL length limits).
Background Context
RFC 10008 defines QUERY as:
- Safe — does not alter server state (like GET)
- Idempotent — multiple identical requests have the same effect
- Cacheable — responses can be cached (keyed by request body via
Content-Location)
- Body-bearing — the request content defines the query
This makes QUERY exempt from CSRF checks (same as GET/HEAD/OPTIONS) and suitable for the routes compiler, SIRD router, and all existing HTTP method infrastructure.
Changes
Core Constants
- Added
QUERY to HttpVerbs trait (Scala) and HttpVerbs interface (Java)
- Added
ACCEPT_QUERY to HeaderNames trait (Scala) and HeaderNames interface (Java)
Routes Compiler
- Added
"QUERY" to the httpVerb parser alternatives in RoutesFileParser.scala
SIRD Router
- Added
QUERY extractor to RequestMethodExtractors trait
Java Routing DSL
- Added
QUERY(String pathPattern) convenience method to RoutingDsl
CSRF Filter
- Added
"QUERY" to CSRFConfig.SafeMethods set (code default)
- Added
"QUERY" to reference.conf method whitelist
Pekko HTTP Server
- Registered
QUERY as a custom method via ParserSettings.withCustomMethods so Pekko HTTP accepts the method without returning 501
Binary Compatibility
- Added MiMa exclusion filters for the new trait members (
ReversedMissingMethodProblem)
Documentation
- Updated HTTP method lists in
ScalaRouting.md, JavaRouting.md
- Updated SIRD extractor docs in
ScalaSirdRouter.md
- Updated Java Routing DSL docs in
JavaRoutingDsl.md
- Updated CSRF safe method docs in
ScalaCsrf.md, JavaCsrf.md
Tests
- Routes compiler parser test
- SIRD router test (
RouterSpec)
- CSRF filter test (
CSRFFilterSpec)
- Java Routing DSL test (
AbstractRoutingDslTest)
- Scripted integration test (routes-compiler-routes-compilation-java)
Upstream Dependencies
Play WS (merged)
Play WS standalone has an open PR for QUERY method support in playframework/play-ws#1366. This adds query[T: BodyWritable](body: T) to the Scala API and query(BodyWritable body) to the Java API. No upstream AHC changes were required — execute("QUERY") preserves the request body for custom method strings.
Pekko HTTP (merged, not yet released)
Apache Pekko HTTP has merged built-in QUERY method support in apache/pekko-http#1077, adding HttpMethods.QUERY as a recognized constant. This landed on main after v2.0.0-M1 and is not yet in a published artifact. Once released, the withCustomMethods workaround in PekkoHttpServer.scala can be removed in favor of the built-in constant.
References
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Implement first-class support for the HTTP QUERY method across the
framework: core constants, routes compiler, SIRD router, Java Routing
DSL, CSRF filter safe methods, and Pekko HTTP custom method registration.
QUERY is safe, idempotent, and body-bearing — combining GET's safety
semantics with POST's ability to carry request content.
Ref: https://www.rfc-editor.org/rfc/rfc10008
|
there is a snpashot which you can use for pekko
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
there is a snpashot which you can use for pekko
Yes, thank you for the pointer! I will track and update when stable release is ready.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Yes, thank you for the pointer! I will track and update when stable release is ready.
I didnt review this pull request, but current Play main branch already uses pekko http snapshot, so you can make use of its query implemention already
|
He-Pin reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Replace HttpMethod.custom("QUERY") with the built-in HttpMethods.QUERY
constant available in Pekko HTTP 2.0.0-M1+169-56f2f5ad-SNAPSHOT
(apache/pekko-http#1077). The withCustomMethods parser registration is
still required as the parser trie only covers the original 9 methods.
I didnt review this pull request, but current Play main branch already uses pekko http snapshot, so you can make use of its query implemention already
Yes, thank you for the pointer! I've updated to use HttpMethods.QUERY from the snapshot. The parser still needs withCustomMethods registration but now uses the built-in constant.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|