-
Mar 3rd, 2012, 02:39 PM
#1
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
-
Mar 24th, 2012, 08:30 AM
#2
Hi, you can see here a workaround.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules