public class RestClientResponseException extends RestClientException
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DEFAULT_CHARSET |
private int |
rawStatusCode |
private byte[] |
responseBody |
private java.lang.String |
responseCharset |
private HttpHeaders |
responseHeaders |
private static long |
serialVersionUID |
private java.lang.String |
statusText |
Constructor and Description |
---|
RestClientResponseException(java.lang.String message,
int statusCode,
java.lang.String statusText,
HttpHeaders responseHeaders,
byte[] responseBody,
java.nio.charset.Charset responseCharset)
Construct a new instance of with the given response data.
|
Modifier and Type | Method and Description |
---|---|
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.
|
HttpHeaders |
getResponseHeaders()
Return the HTTP response headers.
|
java.lang.String |
getStatusText()
Return the HTTP status text.
|
contains, getMessage, getMostSpecificCause, getRootCause
private static final long serialVersionUID
private static final java.lang.String DEFAULT_CHARSET
private final int rawStatusCode
private final java.lang.String statusText
private final byte[] responseBody
private final HttpHeaders responseHeaders
private final java.lang.String responseCharset
public RestClientResponseException(java.lang.String message, int statusCode, java.lang.String statusText, HttpHeaders responseHeaders, byte[] responseBody, java.nio.charset.Charset responseCharset)
statusCode
- the raw status code valuestatusText
- the status textresponseHeaders
- the response headers (may be null
)responseBody
- the response body content (may be null
)responseCharset
- the response body charset (may be null
)public int getRawStatusCode()
public java.lang.String getStatusText()
public HttpHeaders getResponseHeaders()
public byte[] getResponseBodyAsByteArray()
public java.lang.String getResponseBodyAsString()