Skip to content

Support the HTTP QUERY method (RFC 10008) in @RequestMapping / RequestMethod #36988

Description

@jeswr

RFC 10008 (Proposed Standard; IANA-registered) defines QUERY — a safe, idempotent, cacheable HTTP method carrying a request body whose content defines the query.

Problem: Spring MVC / WebFlux route declarations select on the RequestMethod enum (GET/HEAD/POST/PUT/PATCH/DELETE/OPTIONS/TRACE) via @RequestMapping(method = …) and the @GetMapping/@PostMapping shortcuts. There is no RequestMethod.QUERY, so a handler cannot be declaratively mapped to QUERY — the alternatives are matching all methods and inspecting request.getMethod(), or a custom RequestMappingHandlerMapping.

Ask: add RequestMethod.QUERY (and a way to declare it, e.g. @RequestMapping(method = RequestMethod.QUERY)), routed through the request-mapping infrastructure, with the handler able to read the request body, and treated as safe/idempotent where the framework branches on method. (Note: the obvious shortcut name @QueryMapping is already taken by Spring GraphQL, so a different name or plain @RequestMapping would be needed.)

Context: QUERY support is emerging across the ecosystem — Node's undici (nodejs/undici#5459), Eclipse Jetty (jetty/jetty.project#15316), Apache Tomcat (apache/tomcat#1026); and the W3C Linked Web Storage protocol is adopting it (w3c/lws-protocol#179).


Part of a broader RFC 10008 adoption effort: https://github.com/jeswr/http-query-adoption

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions