Jump to solution
Verify

The Fix

Upgrade to version 0.7.5 or later.

Based on closed encode/httpx issue #366 · PR/commit linked

Jump to Verify Open PR/Commit
@@ -32,6 +32,7 @@ from .status_codes import StatusCode from .utils import ( + flatten_queryparams, guess_json_utf, is_known_encoding,
repro.py
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)
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
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).
Production impact:
  • 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. :)”
@sethmlarson · 2019-09-23 · source
“Here's a bit more "live" example: Results:”
@senpos · 2019-09-21 · source
“Hi @Senpos! Thank you for reporting this”
@florimondmanca · 2019-09-21 · source
“Thanks for opening the issue! Retitled to make this more clearly specific.”
@lovelydinosaur · 2019-09-25 · source

Failure Signature (Search String)

  • API calls failed to return expected results due to incorrect query parameter encoding.
Copy-friendly signature
signature.txt
Failure Signature ----------------- API calls failed to return expected results due to incorrect query parameter encoding.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- API calls failed to return expected results due to incorrect query parameter encoding.

Minimal Reproduction

repro.py
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.

When NOT to use: This fix is not applicable if the query parameters are not intended to be lists.

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.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix is not applicable if the query parameters are not intended to be lists.

Verify Fix

verify
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

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