Affects: 5.1.10
It seems that the RestTemplate does not handle exceptions thrown by DELETE the same way as it does for GET and POST.
HttpStatusCodeException.getResponseBodyAsString() returns whitelabel error page as HTML instead of the expected JSON.
Example from exceptional DELETE:
<html><body><h1>Whitelabel Error Page</h1><p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p><div id='created'>Tue Oct 01 15:38:04 CEST 2019</div><div>There was an unexpected error (type=Internal Server Error, status=500).</div><div>I am delete error</div></body></html>
Example from exceptional GET:
{"timestamp":"2019-10-01T13:38:04.682+0000","status":500,"error":"Internal Server Error","message":"I am get error","path":"/test"}
Reproduced in this simple Spring Boot project
Affects: 5.1.10
It seems that the RestTemplate does not handle exceptions thrown by DELETE the same way as it does for GET and POST.
HttpStatusCodeException.getResponseBodyAsString()returns whitelabel error page as HTML instead of the expected JSON.Example from exceptional DELETE:
<html><body><h1>Whitelabel Error Page</h1><p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p><div id='created'>Tue Oct 01 15:38:04 CEST 2019</div><div>There was an unexpected error (type=Internal Server Error, status=500).</div><div>I am delete error</div></body></html>Example from exceptional GET:
{"timestamp":"2019-10-01T13:38:04.682+0000","status":500,"error":"Internal Server Error","message":"I am get error","path":"/test"}Reproduced in this simple Spring Boot project