The Fix
Upgrade to version 0.24.1 or later.
Based on closed encode/httpx issue #1278 · PR/commit linked
@@ -54,6 +54,12 @@ A utility for record and repeat an http request.
This package adds caching functionality to HTTPX
+### httpx-sse
+
+[GitHub](https://github.com/florimondmanca/httpx-sse)
import httpx
from httpx_sse import iter_sse
with httpx.stream("GET", "https://www.example.org/sse") as response:
for sse in iter_sse(response):
print(sse.data, sse.event, sse.id, sse.retry)
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.24.1 or later.\nWhen NOT to use: This fix is not suitable if you require bi-directional communication.\n\n
Why This Fix Works in Production
- Trigger: Users were unable to stream events from servers using HTTPX.
- Mechanism: Added support for Server-Sent Events by integrating the httpx-sse package
- Why the fix works: Added httpx-sse to the list of third-party packages, allowing for consuming Server-Sent Events (SSE) with HTTPX. (first fixed release: 0.24.1).
Why This Breaks in Prod
- Added support for Server-Sent Events by integrating the httpx-sse package
- Production symptom (often without a traceback): Users were unable to stream events from servers using HTTPX.
Proof / Evidence
- GitHub issue: #1278
- Fix PR: https://github.com/encode/httpx/pull/2683
- First fixed release: 0.24.1
- 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.69
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“I worked on an httpx-sse package that I justed pushed here: https://github.com/florimondmanca/httpx-sse The API is a bit different from what @tomchristie suggested”
“I really like this. SSE are a under-used feature of the web in my opinion - I could absolutely see myself hooking up a really…”
“FWIW, I had played with SSE myself in Bocadillo at the time, so just linking to the user docs and the server-side encoding implementation in…”
“+1 on this feature. Using FastAPI with sse-starlette + async integration tests with HTTPX testclient. Having a hard time testing my SSE endpoints due to…”
Failure Signature (Search String)
- Users were unable to stream events from servers using HTTPX.
Copy-friendly signature
Failure Signature
-----------------
Users were unable to stream events from servers using HTTPX.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Users were unable to stream events from servers using HTTPX.
Minimal Reproduction
import httpx
from httpx_sse import iter_sse
with httpx.stream("GET", "https://www.example.org/sse") as response:
for sse in iter_sse(response):
print(sse.data, sse.event, sse.id, sse.retry)
What Broke
Users were unable to stream events from servers using HTTPX.
Why It Broke
Added support for Server-Sent Events by integrating the httpx-sse package
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
Upgrade to version 0.24.1 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/2683
First fixed release: 0.24.1
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix is not suitable if you require bi-directional communication.
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.24.1 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.