类 HttpStatusCodeException
- 所有已实现的接口:
Serializable
public abstract class HttpStatusCodeException extends RestClientResponseException
Abstract base class for exceptions based on anHttpStatus
.- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma, Chris Beams, Rossen Stoyanchev
- 另请参阅:
- 序列化表格
构造器概要
构造器 限定符 构造器 说明 protected
HttpStatusCodeException(HttpStatus statusCode)
Construct a new instance with anHttpStatus
.protected
HttpStatusCodeException(HttpStatus statusCode, String statusText)
Construct a new instance with anHttpStatus
and status text.protected
HttpStatusCodeException(HttpStatus statusCode, String statusText, byte[] responseBody, Charset responseCharset)
Construct instance with anHttpStatus
, status text, and content.protected
HttpStatusCodeException(HttpStatus statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody, Charset responseCharset)
Construct instance with anHttpStatus
, status text, content, and a response charset.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 HttpStatus
getStatusCode()
Return the HTTP status code.从类继承的方法 org.springframework.web.client.RestClientResponseException
getRawStatusCode, getResponseBodyAsByteArray, getResponseBodyAsString, getResponseHeaders, getStatusText
从类继承的方法 org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
构造器详细资料
HttpStatusCodeException
protected HttpStatusCodeException(HttpStatus statusCode)
Construct a new instance with anHttpStatus
.- 参数:
statusCode
- the status code
HttpStatusCodeException
protected HttpStatusCodeException(HttpStatus statusCode, String statusText)
Construct a new instance with anHttpStatus
and status text.- 参数:
statusCode
- the status codestatusText
- the status text
HttpStatusCodeException
protected HttpStatusCodeException(HttpStatus statusCode, String statusText, byte[] responseBody, Charset responseCharset)
Construct instance with anHttpStatus
, status text, and content.- 参数:
statusCode
- the status codestatusText
- the status textresponseBody
- the response body content, may benull
responseCharset
- the response body charset, may benull
- 从以下版本开始:
- 3.0.5
HttpStatusCodeException
protected HttpStatusCodeException(HttpStatus statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody, Charset responseCharset)
Construct instance with anHttpStatus
, status text, content, and a response charset.- 参数:
statusCode
- the status codestatusText
- the status textresponseHeaders
- the response headers, may benull
responseBody
- the response body content, may benull
responseCharset
- the response body charset, may benull
- 从以下版本开始:
- 3.1.2
方法详细资料
getStatusCode
public HttpStatus getStatusCode()
Return the HTTP status code.