Closed
Description
harish opened SPR-9406 and commented
RestTemplates HTTP status codes to only the ones that have associated messages. All 1xx,2xx,3xx,4xx,5xx are legal and valid response codes. RestTempllate should treat them as legal and not throw IllegalArgumentException or ignore message body when any of them are passed. Both code and body should be preserved and passed to caller as such. That would help services and clients make use of flexibility provided by HTTP specifications in using existing status codes and adding their own if no suitable status exists for their needs. This is preventing us from using RestTemplate.
Affects: 3.1.1
Sub-tasks:
- Backport "Unknown status codes (i.e. not in HttpStatus enum) prevent HttpClientErrorException and HttpServerErrorExceptions from being raised" [SPR-9502] #14136 Backport "Unknown status codes (i.e. not in HttpStatus enum) prevent HttpClientErrorException and HttpServerErrorExceptions from being raised"
Issue Links:
- RestTemplate throws IllegalArgumentException when HTTP status is not in the HttpStatus enum [SPR-6752] #11418 RestTemplate throws IllegalArgumentException when HTTP status is not in the HttpStatus enum
- RestTemplate doesn't consistently tolerate unknown HTTP status codes [SPR-15978] #20529 RestTemplate doesn't consistently tolerate unknown HTTP status codes