{{ message }}
Repository navigation
Conversation
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
Contributor
Author
Yes, thank you for the pointer! I will track and update when stable release is ready. |
Member
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 |
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.
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

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:
Content-Location)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
QUERYtoHttpVerbstrait (Scala) andHttpVerbsinterface (Java)ACCEPT_QUERYtoHeaderNamestrait (Scala) andHeaderNamesinterface (Java)Routes Compiler
"QUERY"to thehttpVerbparser alternatives inRoutesFileParser.scalaSIRD Router
QUERYextractor toRequestMethodExtractorstraitJava Routing DSL
QUERY(String pathPattern)convenience method toRoutingDslCSRF Filter
"QUERY"toCSRFConfig.SafeMethodsset (code default)"QUERY"toreference.confmethod whitelistPekko HTTP Server
QUERYas a custom method viaParserSettings.withCustomMethodsso Pekko HTTP accepts the method without returning 501Binary Compatibility
ReversedMissingMethodProblem)Documentation
ScalaRouting.md,JavaRouting.mdScalaSirdRouter.mdJavaRoutingDsl.mdScalaCsrf.md,JavaCsrf.mdTests
RouterSpec)CSRFFilterSpec)AbstractRoutingDslTest)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 andquery(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.QUERYas a recognized constant. This landed onmainafter v2.0.0-M1 and is not yet in a published artifact. Once released, thewithCustomMethodsworkaround inPekkoHttpServer.scalacan be removed in favor of the built-in constant.References