HTTP response wrapper for streaming (InputStream-based) response bodies.
Use this instead of HttpResponse when the response body must be consumed incrementally (e.g. server-sent events, JSON lines).
Value parameters
body
Response body as an InputStream — caller is responsible for closing it, on error statuses too
headers
Response headers as a multi-valued map (lowercase keys) Build one with StreamingHttpResponse.apply and change it with the with* setters; the constructor and copy are private, so a new field never breaks callers.
This response with a body whose reads give up: a read that has waited idle for more bytes fails with a java.net.SocketTimeoutException, and the body is closed. Time the caller spends between reads is not counted. An idle time of zero or less fails the first read that has to wait.
This response with a body whose reads give up: a read that has waited idle for more bytes fails with a java.net.SocketTimeoutException, and the body is closed. Time the caller spends between reads is not counted. An idle time of zero or less fails the first read that has to wait.
For an Llm4sHttpClient whose transport has no read timeout of its own. It relies on closing the body from another thread unblocking a read of it, as it does for a socket and for the JDK HTTP client.