public class WebClientResponseException extends WebClientException
Constructor and Description |
---|
WebClientResponseException(int statusCode,
java.lang.String statusText,
HttpHeaders headers,
byte[] body,
java.nio.charset.Charset charset)
Constructor with response data only, and a default message.
|
WebClientResponseException(java.lang.String message,
int statusCode,
java.lang.String statusText,
HttpHeaders headers,
byte[] responsebody,
java.nio.charset.Charset charset)
Constructor with a prepared message.
|
Modifier and Type | Method and Description |
---|---|
static WebClientResponseException |
create(int statusCode,
java.lang.String statusText,
HttpHeaders headers,
byte[] body,
java.nio.charset.Charset charset)
Create
WebClientResponseException or an HTTP status specific sub-class. |
HttpHeaders |
getHeaders()
Return the HTTP response headers.
|
int |
getRawStatusCode()
Return the raw HTTP status code value.
|
byte[] |
getResponseBodyAsByteArray()
Return the response body as a byte array.
|
java.lang.String |
getResponseBodyAsString()
Return the response body as a string.
|
HttpStatus |
getStatusCode()
Return the HTTP status code value.
|
java.lang.String |
getStatusText()
Return the HTTP status text.
|
contains, getMessage, getMostSpecificCause, getRootCause
public WebClientResponseException(int statusCode, java.lang.String statusText, @Nullable HttpHeaders headers, @Nullable byte[] body, @Nullable java.nio.charset.Charset charset)
public WebClientResponseException(java.lang.String message, int statusCode, java.lang.String statusText, @Nullable HttpHeaders headers, @Nullable byte[] responsebody, @Nullable java.nio.charset.Charset charset)
public HttpStatus getStatusCode()
java.lang.IllegalArgumentException
- in case of an unknown HTTP status codepublic int getRawStatusCode()
public java.lang.String getStatusText()
public HttpHeaders getHeaders()
public byte[] getResponseBodyAsByteArray()
public java.lang.String getResponseBodyAsString()
public static WebClientResponseException create(int statusCode, java.lang.String statusText, HttpHeaders headers, byte[] body, @Nullable java.nio.charset.Charset charset)
WebClientResponseException
or an HTTP status specific sub-class.