public abstract class HttpStatusCodeException extends RestClientException
HttpStatus
.Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DEFAULT_CHARSET |
private byte[] |
responseBody |
private java.lang.String |
responseCharset |
private HttpHeaders |
responseHeaders |
private static long |
serialVersionUID |
private HttpStatus |
statusCode |
private java.lang.String |
statusText |
Modifier | Constructor and Description |
---|---|
protected |
HttpStatusCodeException(HttpStatus statusCode)
Construct a new instance of
HttpStatusCodeException based on an
HttpStatus . |
protected |
HttpStatusCodeException(HttpStatus statusCode,
java.lang.String statusText)
Construct a new instance of
HttpStatusCodeException based on an
HttpStatus and status text. |
protected |
HttpStatusCodeException(HttpStatus statusCode,
java.lang.String statusText,
byte[] responseBody,
java.nio.charset.Charset responseCharset)
Construct a new instance of
HttpStatusCodeException based on an
HttpStatus , status text, and response body content. |
protected |
HttpStatusCodeException(HttpStatus statusCode,
java.lang.String statusText,
HttpHeaders responseHeaders,
byte[] responseBody,
java.nio.charset.Charset responseCharset)
Construct a new instance of
HttpStatusCodeException based on an
HttpStatus , status text, and response body content. |
Modifier and Type | Method and Description |
---|---|
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.
|
HttpStatus |
getStatusCode()
Return the HTTP status code.
|
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 HttpStatus statusCode
private final java.lang.String statusText
private final byte[] responseBody
private final HttpHeaders responseHeaders
private final java.lang.String responseCharset
protected HttpStatusCodeException(HttpStatus statusCode)
HttpStatusCodeException
based on an
HttpStatus
.statusCode
- the status codeprotected HttpStatusCodeException(HttpStatus statusCode, java.lang.String statusText)
HttpStatusCodeException
based on an
HttpStatus
and status text.statusCode
- the status codestatusText
- the status textprotected HttpStatusCodeException(HttpStatus statusCode, java.lang.String statusText, byte[] responseBody, java.nio.charset.Charset responseCharset)
HttpStatusCodeException
based on an
HttpStatus
, status text, and response body content.statusCode
- the status codestatusText
- the status textresponseBody
- the response body content, may be null
responseCharset
- the response body charset, may be null
protected HttpStatusCodeException(HttpStatus statusCode, java.lang.String statusText, HttpHeaders responseHeaders, byte[] responseBody, java.nio.charset.Charset responseCharset)
HttpStatusCodeException
based on an
HttpStatus
, status text, and response body content.statusCode
- the status codestatusText
- 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 HttpStatus getStatusCode()
public java.lang.String getStatusText()
public HttpHeaders getResponseHeaders()
public byte[] getResponseBodyAsByteArray()
public java.lang.String getResponseBodyAsString()