Add support for the HTTP QUERY verb (RFC 10008) - #740
Ricardo Boss (ricardoboss) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new QUERY retry behavior lacks a regression test that exercises an actual QUERY request.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds HTTP QUERY support to Kiota’s Python abstractions and HTTPX retry middleware.
Changes:
- Adds
Method.QUERY. - Allows
QUERYrequests in the default retryable methods. - Updates retry-handler expectations.
File summaries
| File | Description |
|---|---|
packages/abstractions/kiota_abstractions/method.py |
Defines the QUERY method. |
packages/http/httpx/kiota_http/middleware/retry_handler.py |
Enables retries for QUERY. |
packages/http/httpx/tests/middleware_tests/test_retry_handler.py |
Updates allowed-method expectations. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
18cfb80 to
875e2d5
Compare
|
There was a problem hiding this comment.
🔵 Needs a closer look
Redirect handling and retry-path regression coverage remain unresolved.
Review details
Suppressed comments (2)
packages/abstractions/kiota_abstractions/method.py:25
- Adding
Method.QUERYexposes this request type through the default HTTPX middleware, butRedirectHandlerstill changes every non-HEADrequest toGETfor a 302 (packages/http/httpx/kiota_http/middleware/redirect_handler.py:171-174). RFC 10008 requires a QUERY's method and body to be preserved for 302 redirects, so a redirected QUERY is silently downgraded and its body is discarded; update redirect handling and add a regression test before treating QUERY as fully supported.
# The HTTP QUERY method
QUERY = "QUERY"
packages/http/httpx/tests/middleware_tests/test_retry_handler.py:27
- The new assertion only checks that the default set contains the string
QUERY; it does not exercise the retry path with an actualhttpx.Request("QUERY", ...). Add a regression test alongsidetest_retries_validso a future method-specific check cannot make QUERY appear in the constant while still skipping its retry.
['HEAD', 'GET', 'PUT', 'POST', 'PATCH', 'DELETE', 'OPTIONS', 'QUERY']
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
- Review effort level: Lite
Vincent Biret (baywet)
left a comment
There was a problem hiding this comment.
Thank you for making the changes!
|
Actually Ricardo Boss (@ricardoboss) re-reading the bot's comments, and the RFC, I think it's correct for the redirect handler, would you mind looking into this please? And we'll probably need to replicate the change across languages. |



Overview
This adds support for the relatively new HTTP verb
QUERY, which allows sending a request body (likePOST) while being able to be cached (unlikePOST`).Related Issue
Relates to microsoft/kiota#8126