Closed mlippens closed 5 years ago
This is definitely a shortcoming of Unirest. It's like no one ever anticipated the response body would contain anything other than the expected result, even when the server returns an error.
Hello, this should be resolved or addressed in Unirest 2. Please see the upgrade guide for important changes.
Suppose I do a request, and use asObject(MyObject.class), and this fails. I can't do anything anymore with the response if parsing has failed which makes this method useless to me. I have to resort to parsing it myself using jackson or gson in order to avoid doing a second request just to reparse it.
It should somehow be possible to provide an alternative strategy to apply if the first one fails.