i am using .net 5 latest prview..Below is the code for http client in mvc
var response = await _httpClient.SendAsync(request);
try
{
response.EnsureSuccessStatusCode();
data = await response.Content.ReadFromJsonAsync<Abc>();
return data;
}
catch (HttpRequestException ex) when (ex.StatusCode = 404) ----how to check 404 error?
{
throw;
}
catch (HttpRequestException ex) when (ex.StatusCode == 503)
{
throw;
}
How to check 404 error or other details in catch.am getting below error.Thanks in advance...