# Adding support for the HTTP QUERY method

**URL:** <https://forum.djangoproject.com/t/adding-support-for-the-http-query-method/45421>\
**Category:** Django Internals\
**Created:** [July 4, 2026, 2:40pm UTC](https://forum.djangoproject.com/t/adding-support-for-the-http-query-method/45421 "2026-07-04T14:40:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![HiraFatima-Dev](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/hirafatima-dev/32/32750_2.png) [@HiraFatima-Dev](https://forum.djangoproject.com/u/HiraFatima-Dev)\
**Post date:** [July 4, 2026, 2:40pm UTC](https://forum.djangoproject.com/t/adding-support-for-the-http-query-method/45421/1 "2026-07-04T14:40:18Z")

</div>

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]](https://datatracker.ietf.org/doc/rfc10008/)

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.”

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 4, 2026, 2:41pm UTC](https://forum.djangoproject.com/t/adding-support-for-the-http-query-method/45421/2 "2026-07-04T14:41:07Z")

</div>

This is already an active topic.

See [Add support for the HTTP QUERY method (RFC 10008) · Issue #185 · django/new-features · GitHub](https://github.com/django/new-features/issues/185)

---

<div class="post-metadata">

**Author:** ![riheco](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/riheco/32/32983_2.png) [@riheco](https://forum.djangoproject.com/u/riheco)\
**Post date:** [July 30, 2026, 2:51pm UTC](https://forum.djangoproject.com/t/adding-support-for-the-http-query-method/45421/3 "2026-07-30T14:51:43Z")

</div>

That link no longer works. I cannot find any live issue relating to this anymore. One (#186) was closed as a duplicate of another (#185) but #185 appears to be missing as I get a 404 Page not found error.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [July 30, 2026, 3:28pm UTC](https://forum.djangoproject.com/t/adding-support-for-the-http-query-method/45421/4 "2026-07-30T15:28:21Z")

</div>

It looks like 186 is the right one now.

> <https://github.com/django/new-features/issues/186>
>
> \### Code of Conduct
> 
> \- \[x\] I agree to follow Django's Code of Conduct
> 
> \### Featu…re Description
> 
> Add \`"query"\` to \`View.http\_method\_names\` and \`Client.query()\` to the 
> test client to support the HTTP QUERY method defined in RFC 10008 
> (published June 2026 by IETF).
> 
> \### Problem
> 
> RFC 10008 standardizes the HTTP QUERY method as an official IETF standard.
> QUERY fills a long-standing gap: it allows sending a request body (like POST)
> while being explicitly safe and idempotent (like GET), making responses
> cacheable and retries automatic.
> 
> Currently Django does not recognize QUERY as a valid HTTP method. Developers
> who want to handle QUERY requests must manually override \`http\_method\_names\`
> on every view:
> 
> class MyView(View):
> http\_method\_names = \[
> "get", "post", "put", "patch",
> "delete", "head", "options", "trace",
> "query", # manual workaround
> \]
> 
> This workaround should not be necessary for a method that is now part of
> the HTTP standard. Other parts of the ecosystem are already adopting it:
> axios added native support in v1.16.0 (May 2026).
> 
> The fix is minimal: add \`"query"\` to \`View.http\_method\_names\` in
> \`django/views/generic/base.py\` and a \`Client.query()\` helper in
> \`django/test/client.py\`, following the same pattern as existing methods.
> 
> Reference: https://www.rfc-editor.org/rfc/rfc10008
> 
> \### Request or proposal
> 
> proposal
> 
> \### Additional Details
> 
> \_No response\_
> 
> \### Implementation Suggestions
> 
> The change is minimal and follows the exact same pattern as existing methods.
> 
> \*\*1. \`django/views/generic/base.py\`\*\*
> 
> Add \`"query"\` to \`http\_method\_names\`:
> 
> \`\`\`python
> \# Before
> http\_method\_names = \[
> "get", "post", "put", "patch",
> "delete", "head", "options", "trace",
> \]
> 
> \# After
> http\_method\_names = \[
> "get", "post", "put", "patch",
> "delete", "head", "options", "trace",
> "query", # RFC 10008
> \]
> \`\`\`
> 
> \*\*2. \`django/test/client.py\`\*\*
> 
> Add a \`query()\` helper following the same pattern as \`post()\` and \`put()\`:
> 
> \`\`\`python
> def query(self, path, data=None, content\_type="application/json", \*\*extra):
> """Construct a QUERY request."""
> post\_data = self.\_encode\_json(data or {}, content\_type)
> return self.generic("QUERY", path, post\_data, content\_type, \*\*extra)
> \`\`\`
> 
> \*\*3. Tests\*\*
> 
> \`\`\`python
> class QueryMethodTests(SimpleTestCase):
> def test\_query\_in\_http\_method\_names(self):
> self.assertIn("query", View.http\_method\_names)
> 
> def test\_dispatches\_to\_query\_method(self):
> response = self.client.query(
> "/test/",
> data={"filter": "active"},
> )
> self.assertEqual(response.status\_code, 200)
> 
> def test\_missing\_query\_handler\_returns\_405(self):
> # View with no query() method should return 405
> response = self.client.query("/test/")
> self.assertEqual(response.status\_code, 405)
> \`\`\`
> 
> No changes needed to the dispatcher logic — \`dispatch()\` already does
> \`getattr(self, request.method.lower(), self.http\_method\_not\_allowed)\`
> so adding \`"query"\` to the allowed list is sufficient for routing to work.

---

<div class="post-metadata">

**Author:** ![riheco](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/riheco/32/32983_2.png) [@riheco](https://forum.djangoproject.com/u/riheco)\
**Post date:** [July 30, 2026, 4:10pm UTC](https://forum.djangoproject.com/t/adding-support-for-the-http-query-method/45421/5 "2026-07-30T16:10:36Z")

</div>

Except that is now marked as closed as it is a duplicate of #185 which appears not to exist (404 error).

---

<div class="post-metadata">

**Author:** ![blighj](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/blighj/32/29054_2.png) [@blighj](https://forum.djangoproject.com/u/blighj)\
**Post date:** [July 30, 2026, 5:48pm UTC](https://forum.djangoproject.com/t/adding-support-for-the-http-query-method/45421/6 "2026-07-30T17:48:14Z")

</div>

GitHub has been suspending peoples accounts recently, (for reasons I don’t know but I assume are arbitary and the not knowing makes me apprehensive).  
I would say there is a high chance that the missing issue belongs to a community member who has had their account suspended. They will likely get it back, but it could take time.

---

<div class="post-metadata">

**Author:** ![villager](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/villager/32/24305_2.png) [@villager](https://forum.djangoproject.com/u/villager)\
**Post date:** [July 31, 2026, 10:38am UTC](https://forum.djangoproject.com/t/adding-support-for-the-http-query-method/45421/7 "2026-07-31T10:38:38Z")

</div>

What blighj guessed is, unfortunately, correct.

Too follow progress on the QUERY method proposal, please see this ticket:

> **[\#37232 (Add support for the HTTP QUERY method (RFC 10008))
          – Django](https://code.djangoproject.com/ticket/37232)**
