Usage pattern of HttpResponseMessage.EnsureSuccessStatusCode() and handling the HttpRequestException it throws RRS feed

  • Question

  • What's the usage pattern of HttpResponseMessage.EnsureSuccessStatusCode()? It disposes of the Content of the message and throws HttpRequestException, but I fail to see how to programmatically handle it any differently than a generic Exception. For example, it doesn't include the HttpStatusCode, which would have been handy.

    Is there any way of getting more info out of it? Could anyone show relevant usage pattern of bothEnsureSuccessStatusCode() and HttpRequestException?

    Tuesday, January 14, 2014 5:32 PM


All replies