Consume Web API web services

The HttpClient class you have implemented frequently receives error codes, but the application is not responding to them. What should you do?

Trap the OnError event of the request.
Call the EnsureSuccessStatusCode method and trap the HttpRequestException exception.
Check the ResultStatusCode property and throw an exception if one of the error values is present.
Set the EnsureSuccessStatusCode property to true and implement an exception handler in the OnError event.