public class WebClientResponseException extends WebClientException
| Constructor and Description |
|---|
WebClientResponseException(String message,
ClientHttpResponse clientResponse,
List<HttpMessageReader<?>> messageReaders)
Construct a new instance of
WebClientResponseException with the given response data |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getResponseBody(BodyExtractor<T> extractor)
Perform an extraction of the response body into a higher level representation.
|
HttpHeaders |
getResponseHeaders()
Return the HTTP response headers
|
HttpStatus |
getStatus()
Return the HTTP status
|
contains, getMessage, getMostSpecificCause, getRootCauseaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic WebClientResponseException(String message, ClientHttpResponse clientResponse, List<HttpMessageReader<?>> messageReaders)
WebClientResponseException with the given response datamessage - the given error messageclientResponse - the HTTP responsemessageReaders - the message converters that maay decode the HTTP response bodypublic HttpStatus getStatus()
public HttpHeaders getResponseHeaders()
public <T> T getResponseBody(BodyExtractor<T> extractor)
static imports: ResponseExtractors.* String responseBody = clientResponse.getResponseBody(as(String.class));