Hello,
I am getting problem reading stream in below code.
Function A:
Stream responseStream = await HttpHandler.DoPostRequestDownload();
if (responseStream != null)
{
while(stream.ReadByte()>0) // Getting exception here
{
// My Logic
}
}
DoPostRequestDownload Method Which Return Task<Stream>
HttpResponseMessage aResponse = await httpClient.SendAsync(httprequestMessage, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false);
aResponse.EnsureSuccessStatusCode();
Stream stream = await aResponse.Content.ReadAsStreamAsync();
//while(stream.ReadByte()>0) // It works here
//{
// My Logic
// }
return stream;
Please can you help to know what I am doing wrong?
Thanks in advance.