Enable Streaming on Request
Consume Chunks
Middleware + Streaming
You can transform stream chunks in middleware before downstream consumers receive them.SSE Parsing with EventSourceMiddleware
withParser() receives assembled SSE data: payloads.
Operational Notes
- Streaming is one-pass by nature at the transport layer.
- If you need replay/caching, do it explicitly with dedicated stream cache components.
- For mixed usage (
stream()andcontent()), treat them as separate execution paths. HttpClient::withSSEStream()is deprecated; useEventSourceMiddlewareinstead.- For curl streaming,
streamHeaderTimeoutcontrols how long to wait for response headers before throwingTimeoutException.