Abstraction for HTTP client to enable dependency injection and testing.
All methods accept timeout in milliseconds. Headers are passed as single-valued maps. The implementation never throws on non-2xx status codes — callers inspect HttpResponse.statusCode themselves.
POST with a string body and return the response as raw bytes, bypassing charset decoding.
POST with a string body and return the response as raw bytes, bypassing charset decoding.
Use this when the response body is binary (e.g. image data) where decoding to a String and back would corrupt bytes that are not valid in the chosen charset.
POST with a string body and return the response as a streaming InputStream.
POST with a string body and return the response as a streaming InputStream.
Use this for server-sent events or JSON-lines endpoints where the body must be consumed incrementally. The caller is responsible for closing the InputStream.
Default timeout is 10 minutes to accommodate long-running streams.