The Fix
Upgrade to version 0.7.5 or later.
Based on closed encode/httpx issue #366 · PR/commit linked
@@ -32,6 +32,7 @@
from .status_codes import StatusCode
from .utils import (
+ flatten_queryparams,
guess_json_utf,
is_known_encoding,
from httpx.models import QueryParams
from requests.models import RequestEncodingMixin
dict_params = {
"documentIds": ["a55b2f894b90dd1213201471_25", "b54b2f894b90dd1213201471_9"]
}
httpx_params = str(QueryParams(dict_params))
print("httpx", httpx_params)
requests_params = RequestEncodingMixin._encode_params(dict_params)
print("requests", requests_params)
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\nUpgrade to version 0.7.5 or later.\nWhen NOT to use: This fix is not applicable if the query parameters are not intended to be lists.\n\n
Why This Fix Works in Production
- Trigger: API calls failed to return expected results due to incorrect query parameter encoding.
- Mechanism: Multivalued query parameters were incorrectly processed as a Python list instead of being properly encoded
- Why the fix works: Allows lists in query parameters to be properly encoded, fixing the issue where they were incorrectly processed as a Python list. (first fixed release: 0.7.5).
- If left unfixed, this can cause silent data inconsistencies that propagate (bad cache entries, incorrect downstream decisions).
Why This Breaks in Prod
- Multivalued query parameters were incorrectly processed as a Python list instead of being properly encoded
- Production symptom (often without a traceback): API calls failed to return expected results due to incorrect query parameter encoding.
Proof / Evidence
- GitHub issue: #366
- Fix PR: https://github.com/encode/httpx/pull/386
- First fixed release: 0.7.5
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.67
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“We should look at adding some requests compatibility tests for this if they exist. :)”
“Here's a bit more "live" example: Results:”
“Hi @Senpos! Thank you for reporting this”
“Thanks for opening the issue! Retitled to make this more clearly specific.”
Failure Signature (Search String)
- API calls failed to return expected results due to incorrect query parameter encoding.
Copy-friendly signature
Failure Signature
-----------------
API calls failed to return expected results due to incorrect query parameter encoding.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
API calls failed to return expected results due to incorrect query parameter encoding.
Minimal Reproduction
from httpx.models import QueryParams
from requests.models import RequestEncodingMixin
dict_params = {
"documentIds": ["a55b2f894b90dd1213201471_25", "b54b2f894b90dd1213201471_9"]
}
httpx_params = str(QueryParams(dict_params))
print("httpx", httpx_params)
requests_params = RequestEncodingMixin._encode_params(dict_params)
print("requests", requests_params)
What Broke
API calls failed to return expected results due to incorrect query parameter encoding.
Why It Broke
Multivalued query parameters were incorrectly processed as a Python list instead of being properly encoded
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
Upgrade to version 0.7.5 or later.
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/encode/httpx/pull/386
First fixed release: 0.7.5
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix is not applicable if the query parameters are not intended to be lists.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
- Upgrade behind a canary and run integration tests against the canary before 100% rollout.
Version Compatibility Table
| Version | Status |
|---|---|
| 0.7.5 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.