I am asking this question cause i recently discover that it is not good practice to dispose HttpClient in each request. In other hand it's better to use one instance in whole application. So my question is, if it is better or not to dispose HttpResponseMessage after each request. Here is my code:
private static HttpClient httpClient= new HttpClient();
private async Task<string> SendRequest()
{
using (HttpResponseMessage result = await httpClient.GetAsync("www.mysite"))
{
if (result.IsSuccessStatusCode)
return await result.Content.ReadAsStringAsync();
}
return "";
}