I know there are many questions about calling dispose on HttpClient and my understanding is it isn't necessary, but shouldn't (normally) cause any harm in .net core / when using HttpClientFactory. I am wondering about the effect (if any) on 1 particular use case:
HttpResponseMessage response = null;
using (HttpClient client = httpFactory.Create("NEW"))
{
const string url = "https://url";
response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead));
}
Stream stream = await response.Content.ReadAsStreamAsync();
........... use stream .............................
Does disposing the httpclient run the risk of cleaning-up/impacting the HttpResponseMessage/Stream (assume the stream processing take a long time)?
Thanks