Skip to content

Add QUERY method support (RFC 10008)#1055

Open
Diegorro98 wants to merge 3 commits into
pydantic:mainfrom
Diegorro98:implement-query-method-rfc10008
Open

Add QUERY method support (RFC 10008)#1055
Diegorro98 wants to merge 3 commits into
pydantic:mainfrom
Diegorro98:implement-query-method-rfc10008

Conversation

@Diegorro98

@Diegorro98 Diegorro98 commented Jul 6, 2026

Copy link
Copy Markdown

Summary

Implements the QUERY HTTP method as defined in RFC 10008 — a safe, idempotent method that carries a request body to express a query predicate.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

Review in cubic

Diegorro98 and others added 2 commits July 6, 2026 19:27
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
@codspeed-hq

codspeed-hq Bot commented Jul 6, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 15 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing Diegorro98:implement-query-method-rfc10008 (cd0653a) with main (70fac53)

Open in CodSpeed

Footnotes

  1. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 9 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/httpx2/httpx2/_client.py Outdated
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

@mbeijen mbeijen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks. I think the biggest problem is this here:

# Do what the browsers do, despite standards...
# Turn 302s into GETs.
if response.status_code == codes.FOUND and method != "HEAD":
method = "GET"

On HTTP 302 (and NOT on other "redirecty" codes) we turn requests into GET. This is done because "reasons". But QUERY is like a GET so I strongly think that the methods should be preserved here. I'd like to hear thoughts from @Kludex on this though.

Comment thread src/httpx2/httpx2/_api.py
"""
Sends a `QUERY` request.

**Parameters**: See `httpx.request`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is still 'see httpx.request' instead of httpx2.request

"""
Send a `QUERY` request.

**Parameters**: See `httpx.request`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants