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?