RestTemplate Client exchange expects different response body for ResponseErrorHandler
Hi,
I am using RestTemplate as a Client to a server. I use RestTemplate.exchange to send the HTTP POST and indicate that I expect a specific object for the response body. However, if there is a failure on the server side, the server will respond with a response statuscode of 4xx or 5xx and will include an error object in the response body.
I cannot figure out in RestTemplate ResponseErrorHandler how to process an 4xx or 5xx error and map the response.getBody() to an expected error response object. Anyone have any ideas? Is this supported in Spring?
Thanks,
Brian