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