This is because when you have it HttpResponseMessage, it provides the underlying stream. From source :
private HttpContent content;
protected virtual void Dispose(bool disposing)
{
if (disposing && !disposed)
{
disposed = true;
if (content != null)
{
content.Dispose();
}
}
}
, HttpResponseMessage, , StreamReader. :
private async Task<Stream> ExecuteRequestAsync(Uri uri, HttpMethod method)
{
Stream stream = null;
using (HttpRequestMessage httpRequestMessage = new HttpRequestMessage(method, uri))
{
try
{
stopwatch.Start();
HttpResponseMessage responseMessage = await httpClient
.SendAsync(httpRequestMessage)
.ConfigureAwait(false);
stream = await responseMessage.Content.ReadAsStreamAsync()
.ConfigureAwait(false);
}
catch(Exception GettingStreamException)
{
}
}
return stream;
}