public abstract class HttpStatusCodeException
extends org.springframework.web.client.RestClientException
Modifier | Constructor and Description |
---|---|
protected |
HttpStatusCodeException(org.springframework.http.HttpStatus statusCode)
Construct a new instance of
HttpStatusCodeException based on an
HttpStatus . |
protected |
HttpStatusCodeException(org.springframework.http.HttpStatus statusCode,
String statusText)
Construct a new instance of
HttpStatusCodeException based on an
HttpStatus and status text. |
protected |
HttpStatusCodeException(org.springframework.http.HttpStatus statusCode,
String statusText,
byte[] responseBody,
Charset responseCharset)
Construct a new instance of
HttpStatusCodeException based on an
HttpStatus , status text, and response body content. |
protected |
HttpStatusCodeException(org.springframework.http.HttpStatus statusCode,
String statusText,
org.springframework.http.HttpHeaders responseHeaders,
byte[] responseBody,
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.
|
String |
getResponseBodyAsString()
Return the response body as a string.
|
org.springframework.http.HttpHeaders |
getResponseHeaders()
Return the HTTP response headers.
|
org.springframework.http.HttpStatus |
getStatusCode()
Return the HTTP status code.
|
String |
getStatusText()
Return the HTTP status text.
|
contains, getMessage, getMostSpecificCause, getRootCause
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
protected HttpStatusCodeException(org.springframework.http.HttpStatus statusCode)
HttpStatusCodeException
based on an
HttpStatus
.statusCode
- the status codeprotected HttpStatusCodeException(org.springframework.http.HttpStatus statusCode, String statusText)
HttpStatusCodeException
based on an
HttpStatus
and status text.statusCode
- the status codestatusText
- the status textprotected HttpStatusCodeException(org.springframework.http.HttpStatus statusCode, String statusText, byte[] responseBody, 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(org.springframework.http.HttpStatus statusCode, String statusText, org.springframework.http.HttpHeaders responseHeaders, byte[] responseBody, 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 org.springframework.http.HttpStatus getStatusCode()
public String getStatusText()
public org.springframework.http.HttpHeaders getResponseHeaders()
public byte[] getResponseBodyAsByteArray()
public String getResponseBodyAsString()
Copyright © 2010–2020. All rights reserved.