HTTP Get/PostAsync, Reading returned content even with an error

When one uses GetAsync or PostAsync the server might return an error. For example, error 400, or Bad Request. When this happens, GetAsync or PostAsync will error even if the server returns information with the error. It would be nice if we could somehow read the content of what the server returns even if there is an error.

I came across this problem while using the GameAnalytics API, which sends back a 400 response, with data as to what the problem was, when there is a problem with the request.

7 Likes

I completely agree with this, it should return an http error code, the content, and headers perhaps?

2 Likes

Looking into it.

3 Likes