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