Skip to content

Add a query() route shortcut and MethodView support for HTTP QUERY (RFC 10008) #6065

Description

@aliunsal

The HTTP QUERY method was standardized in
RFC 10008 (June 2026): a safe,
idempotent request method that carries content in the request body (the
standardized replacement for the "use POST for a read-only query with a large
body" workaround in GraphQL / REST search APIs).

I'd like Flask to treat QUERY as a first-class method like the others:

  • a query() route shortcut on Scaffold (inherited by Flask and
    Blueprint), mirroring get/post/put/delete/patch;
  • MethodView dispatch of QUERY to a query handler (add "query" to
    views.http_method_funcs).

Is this solvable without changes to Flask? Partly — @app.route("/x", methods=["QUERY"]) already works today, since Flask doesn't restrict method
names and Werkzeug parses the body. What's missing is the ergonomic shortcut and
MethodView dispatch that every other common method already has, so this is a
consistency/ergonomics gap rather than new capability — the same rationale behind
the existing get/post/... shortcuts. Use case: safe, idempotent search
endpoints that need a request body too large or complex for the URL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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