Skip to content

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

Closed as not planned

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

Activity

  1. added
    status: waiting-for-triage
    on Jun 30, 2026
  2. hiSandog commented on Jul 1, 2026

    @hiSandog

    Supporting HTTP QUERY likely touches more than RequestMethod. It may also need coverage in request mapping condition parsing, client-side APIs such as WebClient/RestClient, and server adapters that validate method tokens. It would be helpful to decide whether Spring should expose QUERY as a first-class enum value or document a generic custom-method path for newer RFC methods.

  3. desiderantes commented on Jul 1, 2026

    @desiderantes
    Contributor

    I have a PR for this already, I'd appreciate any suggestions: #34993

  4. added
    status: duplicate
    and removed
    status: waiting-for-triage
    on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: duplicate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions