类 HttpClientErrorException
- 所有已实现的接口:
Serializable
- 直接已知子类:
HttpClientErrorException.BadRequest
,HttpClientErrorException.Conflict
,HttpClientErrorException.Forbidden
,HttpClientErrorException.Gone
,HttpClientErrorException.MethodNotAllowed
,HttpClientErrorException.NotAcceptable
,HttpClientErrorException.NotFound
,HttpClientErrorException.TooManyRequests
,HttpClientErrorException.Unauthorized
,HttpClientErrorException.UnprocessableEntity
,HttpClientErrorException.UnsupportedMediaType
public class HttpClientErrorException extends HttpStatusCodeException
Exception thrown when an HTTP 4xx is received.- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma
- 另请参阅:
DefaultResponseErrorHandler
, 序列化表格
嵌套类概要
构造器概要
构造器 构造器 说明 HttpClientErrorException(String message, HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset responseCharset)
Constructor with a status code and status text, headers, and content, and an prepared message.HttpClientErrorException(HttpStatus statusCode)
Constructor with a status code only.HttpClientErrorException(HttpStatus statusCode, String statusText)
Constructor with a status code and status text.HttpClientErrorException(HttpStatus statusCode, String statusText, byte[] body, Charset responseCharset)
Constructor with a status code and status text, and content.HttpClientErrorException(HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset responseCharset)
Constructor with a status code and status text, headers, and content.
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static HttpClientErrorException
create(String message, HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset)
Variant ofcreate(HttpStatus, String, HttpHeaders, byte[], Charset)
with an optional prepared message.static HttpClientErrorException
create(HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset)
CreateHttpClientErrorException
or an HTTP status specific sub-class.从类继承的方法 org.springframework.web.client.HttpStatusCodeException
getStatusCode
从类继承的方法 org.springframework.web.client.RestClientResponseException
getRawStatusCode, getResponseBodyAsByteArray, getResponseBodyAsString, getResponseBodyAsString, getResponseHeaders, getStatusText
从类继承的方法 org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
构造器详细资料
HttpClientErrorException
public HttpClientErrorException(HttpStatus statusCode)
Constructor with a status code only.
HttpClientErrorException
public HttpClientErrorException(HttpStatus statusCode, String statusText)
Constructor with a status code and status text.
HttpClientErrorException
public HttpClientErrorException(HttpStatus statusCode, String statusText, @Nullable byte[] body, @Nullable Charset responseCharset)
Constructor with a status code and status text, and content.
HttpClientErrorException
public HttpClientErrorException(HttpStatus statusCode, String statusText, @Nullable HttpHeaders headers, @Nullable byte[] body, @Nullable Charset responseCharset)
Constructor with a status code and status text, headers, and content.
HttpClientErrorException
public HttpClientErrorException(String message, HttpStatus statusCode, String statusText, @Nullable HttpHeaders headers, @Nullable byte[] body, @Nullable Charset responseCharset)
Constructor with a status code and status text, headers, and content, and an prepared message.- 从以下版本开始:
- 5.2.2
方法详细资料
create
public static HttpClientErrorException create(HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, @Nullable Charset charset)
CreateHttpClientErrorException
or an HTTP status specific sub-class.- 从以下版本开始:
- 5.1
create
public static HttpClientErrorException create(@Nullable String message, HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, @Nullable Charset charset)
Variant ofcreate(HttpStatus, String, HttpHeaders, byte[], Charset)
with an optional prepared message.- 从以下版本开始:
- 5.2.2