Adding support for the HTTP QUERY method

HTTP recently gained a new request method, QUERY, standardized in
June 2026 — the first new HTTP verb since PATCH. It’s safe and idempotent
like GET, but allows a request body like POST, intended for complex
search/filter requests that don’t fit well in a URL query string.

Spec reference: [link to the IETF draft/RFC]

I’d like to propose adding QUERY support to Django and get feedback on
scope and design before writing a patch.

Why this might matter for Django

  • Django added PATCH support in 1.5 when it was newly standardized; QUERY
    is a similar case — a new safe/idempotent verb that doesn’t fit GET or
    POST.
  • Search-heavy APIs built with Django (DRF or plain views) currently have
    to either cram filters into query strings or misuse POST for what’s
    semantically a read operation.

Proposed scope

  • View.http_method_names — add "query" so CBVs can define a query()
    handler, mirroring how patch() works today.
  • HttpRequest — likely no change needed if WSGI/ASGI already pass
    arbitrary methods through (need to confirm).
  • CSRF middleware — QUERY is safe/idempotent; should it be exempted from
    CSRF checks the way GET/HEAD/OPTIONS/TRACE are? Probably the biggest
    open design question.
  • Conditional GET / cache framework (django.utils.cache,
    django.views.decorators.http) — should QUERY be treated as cacheable
    the way GET is, given it’s defined as safe?
  • Test Client / RequestFactory — add a .query() method following
    the pattern used for .trace() and .patch().

Open questions for discussion

  1. Is it premature to add this given WSGI/ASGI/server ecosystem support
    is still thin, or is now the right time (as with PATCH)?
  2. Should QUERY be CSRF-exempt by default?
  3. Should this land in core at all, or make more sense as a third-party
    package until adoption is more established?

I’m a relatively new contributor and this would be my first significant
patch, so I’d appreciate guidance on scope even if the answer is “not
yet” or “let’s see this proven out elsewhere first.”

This is already an active topic.

See Add support for the HTTP QUERY method (RFC 10008) · Issue #185 · django/new-features · GitHub