How to handle HTTP Status = 0?
winanjaya
146
Reputation points
Hi
Our ASP.NET Core 6 Web API consume a 3rd party Web API, sometimes we get http status 0 and I don't know what does it mean?, I have tried to handle this using Polly but it doesn't arrive there?
HttpResponseMessage httpRes = _httpClient.GetAsync(url).Result;
iStatusCode = (int)httpRes.StatusCode;
if (httpRes.IsSuccessStatusCode)
{
string _res = httpRes.Content.ReadAsStringAsync().Result;
// some tasks
}
await Models.Tokens.Log.UpdateAsync(tokensPid, iStatusCode);
Polly:
Developer technologies ASP.NET ASP.NET Core
4,815 questions
Developer technologies C#
11,567 questions
Sign in to answer