Enum Class HttpStatus
- 所有已实现的接口:
HttpStatusCode,Serializable,Comparable<HttpStatus>,Constable
Enumeration of HTTP status codes.
The HTTP status code series can be retrieved via series().
- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma, Sebastien Deleuze, Brian Clozel, TODAY 2020/12/6 15:51
- 另请参阅:
-
嵌套类概要
嵌套类从类继承的嵌套类/接口 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
枚举常量概要
枚举常量枚举常量说明202 Accepted.208 Already Reported.502 Bad Gateway.400 Bad Request.509 Bandwidth Limit Exceeded已过时。409 Conflict.100 Continue.201 Created.已过时。{code 103 Early Hints}.417 Expectation Failed.424 Failed Dependency.403 Forbidden.302 Found.504 Gateway Timeout.410 Gone.505 HTTP Version Not Supported.418 I'm a teapot.226 IM Used.已过时。507 Insufficient Storage500 Internal Server Error.411 Length Required.423 Locked.508 Loop Detected已过时。405 Method Not Allowed.301 Moved Permanently.已过时。in favor ofFOUNDwhich will be returned fromHttpStatus.valueOf(302)207 Multi-Status.300 Multiple Choices.511 Network Authentication Required.204 No Content.203 Non-Authoritative Information.406 Not Acceptable.510 Not Extended404 Not Found.501 Not Implemented.304 Not Modified.200 OK.206 Partial Content.413 Payload Too Large.402 Payment Required.308 Permanent Redirect.412 Precondition failed.428 Precondition Required.102 Processing.407 Proxy Authentication Required.已过时。in favor ofPAYLOAD_TOO_LARGEwhich will be returned fromHttpStatus.valueOf(413)431 Request Header Fields Too Large.408 Request Timeout.已过时。in favor ofURI_TOO_LONGwhich will be returned fromHttpStatus.valueOf(414)416 Requested Range Not Satisfiable.205 Reset Content.303 See Other.503 Service Unavailable.101 Switching Protocols.307 Temporary Redirect.425 Too Early.429 Too Many Requests.401 Unauthorized.451 Unavailable For Legal Reasons.422 Unprocessable Entity.415 Unsupported Media Type.426 Upgrade Required.414 URI Too Long.已过时。due to security concerns regarding in-band configuration of a proxy506 Variant Also Negotiates -
字段概要
字段修饰符和类型字段说明private final Stringprivate final HttpStatus.Seriesprivate final intprivate static final HttpStatus[] -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Return the reason phrase of this status code.booleanWhether this status code is in the HTTP seriesHttpStatus.Series.INFORMATIONAL.booleanWhether this status code is in the HTTP seriesHttpStatus.Series.SUCCESSFUL.booleanWhether this status code is in the HTTP seriesHttpStatus.Series.REDIRECTION.booleanWhether this status code is in the HTTP seriesHttpStatus.Series.CLIENT_ERROR.booleanWhether this status code is in the HTTP seriesHttpStatus.Series.SERVER_ERROR.booleanisError()Whether this status code is in the HTTP seriesHttpStatus.Series.CLIENT_ERRORorHttpStatus.Series.SERVER_ERROR.static HttpStatusresolve(int statusCode) Resolve the given status code to anHttpStatus, if possible.series()Return the HTTP status series of this status code.toString()Return a string representation of this status code.intvalue()Return the integer value of this status code.static HttpStatusvalueOf(int statusCode) Return theHttpStatusenum constant with the specified numeric value.static HttpStatusReturns the enum constant of this class with the specified name.static HttpStatus[]values()Returns an array containing the constants of this enum class, in the order they are declared.从类继承的方法 java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf从接口继承的方法 cn.taketoday.http.HttpStatusCode
isSameCodeAs
-
枚举常量详细资料
-
CONTINUE
100 Continue. -
SWITCHING_PROTOCOLS
101 Switching Protocols. -
PROCESSING
102 Processing.- 另请参阅:
-
EARLY_HINTS
{code 103 Early Hints}. -
CHECKPOINT
已过时。in favor ofEARLY_HINTSwhich will be returned fromHttpStatus.valueOf(103)103 Checkpoint. -
OK
200 OK. -
CREATED
201 Created. -
ACCEPTED
202 Accepted. -
NON_AUTHORITATIVE_INFORMATION
203 Non-Authoritative Information. -
NO_CONTENT
204 No Content. -
RESET_CONTENT
205 Reset Content. -
PARTIAL_CONTENT
206 Partial Content. -
MULTI_STATUS
207 Multi-Status.- 另请参阅:
-
ALREADY_REPORTED
208 Already Reported. -
IM_USED
226 IM Used.- 另请参阅:
-
MULTIPLE_CHOICES
300 Multiple Choices. -
MOVED_PERMANENTLY
301 Moved Permanently. -
FOUND
302 Found. -
MOVED_TEMPORARILY
已过时。in favor ofFOUNDwhich will be returned fromHttpStatus.valueOf(302)302 Moved Temporarily.- 另请参阅:
-
SEE_OTHER
303 See Other. -
NOT_MODIFIED
304 Not Modified. -
USE_PROXY
已过时。due to security concerns regarding in-band configuration of a proxy305 Use Proxy. -
TEMPORARY_REDIRECT
307 Temporary Redirect. -
PERMANENT_REDIRECT
308 Permanent Redirect.- 另请参阅:
-
BAD_REQUEST
400 Bad Request. -
UNAUTHORIZED
401 Unauthorized. -
PAYMENT_REQUIRED
402 Payment Required. -
FORBIDDEN
403 Forbidden. -
NOT_FOUND
404 Not Found. -
METHOD_NOT_ALLOWED
405 Method Not Allowed. -
NOT_ACCEPTABLE
406 Not Acceptable. -
PROXY_AUTHENTICATION_REQUIRED
407 Proxy Authentication Required. -
REQUEST_TIMEOUT
408 Request Timeout. -
CONFLICT
409 Conflict. -
GONE
410 Gone. -
LENGTH_REQUIRED
411 Length Required. -
PRECONDITION_FAILED
412 Precondition failed. -
PAYLOAD_TOO_LARGE
413 Payload Too Large.- 从以下版本开始:
- 4.0
- 另请参阅:
-
REQUEST_ENTITY_TOO_LARGE
已过时。in favor ofPAYLOAD_TOO_LARGEwhich will be returned fromHttpStatus.valueOf(413)413 Request Entity Too Large. -
URI_TOO_LONG
414 URI Too Long.- 从以下版本开始:
- 4.0
- 另请参阅:
-
REQUEST_URI_TOO_LONG
已过时。in favor ofURI_TOO_LONGwhich will be returned fromHttpStatus.valueOf(414)414 Request-URI Too Long. -
UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type. -
REQUESTED_RANGE_NOT_SATISFIABLE
416 Requested Range Not Satisfiable. -
EXPECTATION_FAILED
417 Expectation Failed. -
I_AM_A_TEAPOT
418 I'm a teapot.- 另请参阅:
-
INSUFFICIENT_SPACE_ON_RESOURCE
已过时。 -
METHOD_FAILURE
已过时。 -
DESTINATION_LOCKED
已过时。 -
UNPROCESSABLE_ENTITY
422 Unprocessable Entity.- 另请参阅:
-
LOCKED
423 Locked.- 另请参阅:
-
FAILED_DEPENDENCY
424 Failed Dependency.- 另请参阅:
-
TOO_EARLY
425 Too Early.- 另请参阅:
-
UPGRADE_REQUIRED
426 Upgrade Required. -
PRECONDITION_REQUIRED
428 Precondition Required. -
TOO_MANY_REQUESTS
429 Too Many Requests. -
REQUEST_HEADER_FIELDS_TOO_LARGE
431 Request Header Fields Too Large. -
UNAVAILABLE_FOR_LEGAL_REASONS
451 Unavailable For Legal Reasons. -
INTERNAL_SERVER_ERROR
500 Internal Server Error. -
NOT_IMPLEMENTED
501 Not Implemented. -
BAD_GATEWAY
502 Bad Gateway. -
SERVICE_UNAVAILABLE
503 Service Unavailable. -
GATEWAY_TIMEOUT
504 Gateway Timeout. -
HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported. -
VARIANT_ALSO_NEGOTIATES
506 Variant Also Negotiates -
INSUFFICIENT_STORAGE
507 Insufficient Storage- 另请参阅:
-
LOOP_DETECTED
508 Loop Detected -
BANDWIDTH_LIMIT_EXCEEDED
509 Bandwidth Limit Exceeded -
NOT_EXTENDED
510 Not Extended- 另请参阅:
-
NETWORK_AUTHENTICATION_REQUIRED
511 Network Authentication Required.
-
-
字段详细资料
-
VALUES
-
value
private final int value -
series
-
reasonPhrase
-
-
构造器详细资料
-
HttpStatus
-
-
方法详细资料
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- 返回:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- 参数:
name- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- 如果参数为空值
-
value
public int value()Return the integer value of this status code.- 指定者:
value在接口中HttpStatusCode
-
getReasonPhrase
Return the reason phrase of this status code. -
series
Return the HTTP status series of this status code.- 另请参阅:
-
is1xxInformational
public boolean is1xxInformational()Whether this status code is in the HTTP seriesHttpStatus.Series.INFORMATIONAL.This is a shortcut for checking the value of
series().- 指定者:
is1xxInformational在接口中HttpStatusCode- 另请参阅:
-
is2xxSuccessful
public boolean is2xxSuccessful()Whether this status code is in the HTTP seriesHttpStatus.Series.SUCCESSFUL.This is a shortcut for checking the value of
series().- 指定者:
is2xxSuccessful在接口中HttpStatusCode- 另请参阅:
-
is3xxRedirection
public boolean is3xxRedirection()Whether this status code is in the HTTP seriesHttpStatus.Series.REDIRECTION.This is a shortcut for checking the value of
series().- 指定者:
is3xxRedirection在接口中HttpStatusCode- 另请参阅:
-
is4xxClientError
public boolean is4xxClientError()Whether this status code is in the HTTP seriesHttpStatus.Series.CLIENT_ERROR.This is a shortcut for checking the value of
series().- 指定者:
is4xxClientError在接口中HttpStatusCode- 另请参阅:
-
is5xxServerError
public boolean is5xxServerError()Whether this status code is in the HTTP seriesHttpStatus.Series.SERVER_ERROR.This is a shortcut for checking the value of
series().- 指定者:
is5xxServerError在接口中HttpStatusCode- 另请参阅:
-
isError
public boolean isError()Whether this status code is in the HTTP seriesHttpStatus.Series.CLIENT_ERRORorHttpStatus.Series.SERVER_ERROR.This is a shortcut for checking the value of
series().- 指定者:
isError在接口中HttpStatusCode- 另请参阅:
-
toString
Return a string representation of this status code.- 覆盖:
toString在类中Enum<HttpStatus>
-
valueOf
Return theHttpStatusenum constant with the specified numeric value.- 参数:
statusCode- the numeric value of the enum to be returned- 返回:
- the enum constant with the specified numeric value
- 抛出:
IllegalArgumentException- if this enum has no constant for the specified numeric value
-
resolve
Resolve the given status code to anHttpStatus, if possible.- 参数:
statusCode- the HTTP status code (potentially non-standard)- 返回:
- the corresponding
HttpStatus, ornullif not found
-
EARLY_HINTSwhich will be returned fromHttpStatus.valueOf(103)