Does a http client return a stream as the response or does it reads the bytes from the stream and returns us the response ?
If it returns a stream , the user will have to read from that stream to get the response right ?
For example - We are using ApacheAsyncHttpClient to get blobs from Azure Storage. The REST response should only contain the stream from where to read the blob right ? But what I observed is that the client itself is reading all the bytes from the stream before invoking our completed Callback.
And unless the data from the stream is read , the HTTP connection is kept open ?
Edit - We cant use sdk for reasons beyond the scope of this question. My question is specifically for ApacheAsyncHttpClient.
It reads the entire stream before calling the completed callback. Ideally, what I would want is that it returns me the stream and my application will read from that stream. Is there a way to do that ? And are all http clients behave similarly ?