WebClientException should allow access to status code of the response
This commit changes the WebClient so that it now throws a `WebClientResponseException` for `ResponseSpec.bodyTo`. This newly introduces exception contains the status code, headers, and body of the response message. As a consequence of the above, we had to change `onStatus` so that the `exceptionFunction` now returns a `Mono<Throwable>` rather than a `Throwable`, which it was before. The Mono allows for asynchronous operations, such as reading the contents of the body. Issue: SPR-15824
This commit is contained in:
@@ -73,6 +73,10 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
||||
|
||||
private static final long serialVersionUID = -8578554704772377436L;
|
||||
|
||||
/**
|
||||
* The empty {@code HttpHeaders} instance (immutable).
|
||||
*/
|
||||
public static final HttpHeaders EMPTY = new HttpHeaders(new LinkedHashMap<>(0), true);
|
||||
/**
|
||||
* The HTTP {@code Accept} header field name.
|
||||
* @see <a href="http://tools.ietf.org/html/rfc7231#section-5.3.2">Section 5.3.2 of RFC 7231</a>
|
||||
|
||||
Reference in New Issue
Block a user