org.springframework.http
Enum HttpStatus

java.lang.Object
  extended by java.lang.Enum<HttpStatus>
      extended by org.springframework.http.HttpStatus
All Implemented Interfaces:
Serializable, Comparable<HttpStatus>

public enum HttpStatus
extends Enum<HttpStatus>

Java 5 enumeration of HTTP status codes.

The HTTP status code series can be retrieved via series().

Author:
Arjen Poutsma
See Also:
HttpStatus.Series, HTTP Status Code Registry

Nested Class Summary
static class HttpStatus.Series
          Java 5 enumeration of HTTP status series.
 
Enum Constant Summary
ACCEPTED
          202 Accepted.
ALREADY_REPORTED
          208 Already Reported.
BAD_GATEWAY
          502 Bad Gateway.
BAD_REQUEST
          400 Bad Request.
CONFLICT
          409 Conflict.
CONTINUE
          100 Continue.
CREATED
          201 Created.
DESTINATION_LOCKED
          421 Destination Locked.
EXPECTATION_FAILED
          417 Expectation Failed.
FAILED_DEPENDENCY
          424 Failed Dependency.
FORBIDDEN
          403 Forbidden.
FOUND
          302 Found.
GATEWAY_TIMEOUT
          504 Gateway Timeout.
GONE
          410 Gone.
HTTP_VERSION_NOT_SUPPORTED
          505 HTTP Version Not Supported.
IM_USED
          226 IM Used.
INSUFFICIENT_SPACE_ON_RESOURCE
          419 Insufficient Space on Resource.
INSUFFICIENT_STORAGE
          507 Insufficient Storage
INTERNAL_SERVER_ERROR
          500 Internal Server Error.
LENGTH_REQUIRED
          411 Length Required.
LOCKED
          423 Locked.
LOOP_DETECTED
          508 Loop Detected
METHOD_FAILURE
          420 Method Failure.
METHOD_NOT_ALLOWED
          405 Method Not Allowed.
MOVED_PERMANENTLY
          301 Moved Permanently.
MOVED_TEMPORARILY
          302 Moved Temporarily.
MULTI_STATUS
          207 Multi-Status.
MULTIPLE_CHOICES
          300 Multiple Choices.
NO_CONTENT
          204 No Content.
NON_AUTHORITATIVE_INFORMATION
          203 Non-Authoritative Information.
NOT_ACCEPTABLE
          406 Not Acceptable.
NOT_EXTENDED
          510 Not Extended
NOT_FOUND
          404 Not Found.
NOT_IMPLEMENTED
          501 Not Implemented.
NOT_MODIFIED
          304 Not Modified.
OK
          200 OK.
PARTIAL_CONTENT
          206 Partial Content.
PAYMENT_REQUIRED
          402 Payment Required.
PRECONDITION_FAILED
          412 Precondition failed.
PROCESSING
          102 Processing.
PROXY_AUTHENTICATION_REQUIRED
          407 Proxy Authentication Required.
REQUEST_ENTITY_TOO_LARGE
          413 Request Entity Too Large.
REQUEST_TIMEOUT
          408 Request Timeout.
REQUEST_URI_TOO_LONG
          414 Request-URI Too Long.
REQUESTED_RANGE_NOT_SATISFIABLE
          416 Requested Range Not Satisfiable.
RESET_CONTENT
          205 Reset Content.
SEE_OTHER
          303 See Other.
SERVICE_UNAVAILABLE
          503 Service Unavailable.
SWITCHING_PROTOCOLS
          101 Switching Protocols.
TEMPORARY_REDIRECT
          307 Temporary Redirect.
UNAUTHORIZED
          401 Unauthorized.
UNPROCESSABLE_ENTITY
          422 Unprocessable Entity.
UNSUPPORTED_MEDIA_TYPE
          415 Unsupported Media Type.
UPGRADE_REQUIRED
          426 Upgrade Required.
USE_PROXY
          305 Use Proxy.
VARIANT_ALSO_NEGOTIATES
          506 Variant Also Negotiates
 
Method Summary
 HttpStatus.Series series()
          Returns the HTTP status series of this status code.
 String toString()
          Return a string representation of this status code.
 int value()
          Return the integer value of this status code.
static HttpStatus valueOf(int statusCode)
          Return the enum constant of this type with the specified numeric value.
static HttpStatus valueOf(String name)
          Returns the enum constant of this type with the specified name.
static HttpStatus[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CONTINUE

public static final HttpStatus CONTINUE
100 Continue.

See Also:
HTTP/1.1

SWITCHING_PROTOCOLS

public static final HttpStatus SWITCHING_PROTOCOLS
101 Switching Protocols.

See Also:
HTTP/1.1

PROCESSING

public static final HttpStatus PROCESSING
102 Processing.

See Also:
WebDAV

OK

public static final HttpStatus OK
200 OK.

See Also:
HTTP/1.1

CREATED

public static final HttpStatus CREATED
201 Created.

See Also:
HTTP/1.1

ACCEPTED

public static final HttpStatus ACCEPTED
202 Accepted.

See Also:
HTTP/1.1

NON_AUTHORITATIVE_INFORMATION

public static final HttpStatus NON_AUTHORITATIVE_INFORMATION
203 Non-Authoritative Information.

See Also:
HTTP/1.1

NO_CONTENT

public static final HttpStatus NO_CONTENT
204 No Content.

See Also:
HTTP/1.1

RESET_CONTENT

public static final HttpStatus RESET_CONTENT
205 Reset Content.

See Also:
HTTP/1.1

PARTIAL_CONTENT

public static final HttpStatus PARTIAL_CONTENT
206 Partial Content.

See Also:
HTTP/1.1

MULTI_STATUS

public static final HttpStatus MULTI_STATUS
207 Multi-Status.

See Also:
WebDAV

ALREADY_REPORTED

public static final HttpStatus ALREADY_REPORTED
208 Already Reported.

See Also:
WebDAV Binding Extensions

IM_USED

public static final HttpStatus IM_USED
226 IM Used.

See Also:
Delta encoding in HTTP

MULTIPLE_CHOICES

public static final HttpStatus MULTIPLE_CHOICES
300 Multiple Choices.

See Also:
HTTP/1.1

MOVED_PERMANENTLY

public static final HttpStatus MOVED_PERMANENTLY
301 Moved Permanently.

See Also:
HTTP/1.1

FOUND

public static final HttpStatus FOUND
302 Found.

See Also:
HTTP/1.1

MOVED_TEMPORARILY

public static final HttpStatus MOVED_TEMPORARILY
302 Moved Temporarily.

See Also:
HTTP/1.0

SEE_OTHER

public static final HttpStatus SEE_OTHER
303 See Other.

See Also:
HTTP/1.1

NOT_MODIFIED

public static final HttpStatus NOT_MODIFIED
304 Not Modified.

See Also:
HTTP/1.1

USE_PROXY

public static final HttpStatus USE_PROXY
305 Use Proxy.

See Also:
HTTP/1.1

TEMPORARY_REDIRECT

public static final HttpStatus TEMPORARY_REDIRECT
307 Temporary Redirect.

See Also:
HTTP/1.1

BAD_REQUEST

public static final HttpStatus BAD_REQUEST
400 Bad Request.

See Also:
HTTP/1.1

UNAUTHORIZED

public static final HttpStatus UNAUTHORIZED
401 Unauthorized.

See Also:
HTTP/1.1

PAYMENT_REQUIRED

public static final HttpStatus PAYMENT_REQUIRED
402 Payment Required.

See Also:
HTTP/1.1

FORBIDDEN

public static final HttpStatus FORBIDDEN
403 Forbidden.

See Also:
HTTP/1.1

NOT_FOUND

public static final HttpStatus NOT_FOUND
404 Not Found.

See Also:
HTTP/1.1

METHOD_NOT_ALLOWED

public static final HttpStatus METHOD_NOT_ALLOWED
405 Method Not Allowed.

See Also:
HTTP/1.1

NOT_ACCEPTABLE

public static final HttpStatus NOT_ACCEPTABLE
406 Not Acceptable.

See Also:
HTTP/1.1

PROXY_AUTHENTICATION_REQUIRED

public static final HttpStatus PROXY_AUTHENTICATION_REQUIRED
407 Proxy Authentication Required.

See Also:
HTTP/1.1

REQUEST_TIMEOUT

public static final HttpStatus REQUEST_TIMEOUT
408 Request Timeout.

See Also:
HTTP/1.1

CONFLICT

public static final HttpStatus CONFLICT
409 Conflict.

See Also:
HTTP/1.1

GONE

public static final HttpStatus GONE
410 Gone.

See Also:
HTTP/1.1

LENGTH_REQUIRED

public static final HttpStatus LENGTH_REQUIRED
411 Length Required.

See Also:
HTTP/1.1

PRECONDITION_FAILED

public static final HttpStatus PRECONDITION_FAILED
412 Precondition failed.

See Also:
HTTP/1.1

REQUEST_ENTITY_TOO_LARGE

public static final HttpStatus REQUEST_ENTITY_TOO_LARGE
413 Request Entity Too Large.

See Also:
HTTP/1.1

REQUEST_URI_TOO_LONG

public static final HttpStatus REQUEST_URI_TOO_LONG
414 Request-URI Too Long.

See Also:
HTTP/1.1

UNSUPPORTED_MEDIA_TYPE

public static final HttpStatus UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type.

See Also:
HTTP/1.1

REQUESTED_RANGE_NOT_SATISFIABLE

public static final HttpStatus REQUESTED_RANGE_NOT_SATISFIABLE
416 Requested Range Not Satisfiable.

See Also:
HTTP/1.1

EXPECTATION_FAILED

public static final HttpStatus EXPECTATION_FAILED
417 Expectation Failed.

See Also:
HTTP/1.1

INSUFFICIENT_SPACE_ON_RESOURCE

public static final HttpStatus INSUFFICIENT_SPACE_ON_RESOURCE
419 Insufficient Space on Resource.

See Also:
WebDAV Draft

METHOD_FAILURE

public static final HttpStatus METHOD_FAILURE
420 Method Failure.

See Also:
WebDAV Draft

DESTINATION_LOCKED

public static final HttpStatus DESTINATION_LOCKED
421 Destination Locked.

See Also:
WebDAV Draft

UNPROCESSABLE_ENTITY

public static final HttpStatus UNPROCESSABLE_ENTITY
422 Unprocessable Entity.

See Also:
WebDAV

LOCKED

public static final HttpStatus LOCKED
423 Locked.

See Also:
WebDAV

FAILED_DEPENDENCY

public static final HttpStatus FAILED_DEPENDENCY
424 Failed Dependency.

See Also:
WebDAV

UPGRADE_REQUIRED

public static final HttpStatus UPGRADE_REQUIRED
426 Upgrade Required.

See Also:
Upgrading to TLS Within HTTP/1.1

INTERNAL_SERVER_ERROR

public static final HttpStatus INTERNAL_SERVER_ERROR
500 Internal Server Error.

See Also:
HTTP/1.1

NOT_IMPLEMENTED

public static final HttpStatus NOT_IMPLEMENTED
501 Not Implemented.

See Also:
HTTP/1.1

BAD_GATEWAY

public static final HttpStatus BAD_GATEWAY
502 Bad Gateway.

See Also:
HTTP/1.1

SERVICE_UNAVAILABLE

public static final HttpStatus SERVICE_UNAVAILABLE
503 Service Unavailable.

See Also:
HTTP/1.1

GATEWAY_TIMEOUT

public static final HttpStatus GATEWAY_TIMEOUT
504 Gateway Timeout.

See Also:
HTTP/1.1

HTTP_VERSION_NOT_SUPPORTED

public static final HttpStatus HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported.

See Also:
HTTP/1.1

VARIANT_ALSO_NEGOTIATES

public static final HttpStatus VARIANT_ALSO_NEGOTIATES
506 Variant Also Negotiates

See Also:
Transparent Content Negotiation

INSUFFICIENT_STORAGE

public static final HttpStatus INSUFFICIENT_STORAGE
507 Insufficient Storage

See Also:
WebDAV

LOOP_DETECTED

public static final HttpStatus LOOP_DETECTED
508 Loop Detected

See Also:
WebDAV Binding Extensions

NOT_EXTENDED

public static final HttpStatus NOT_EXTENDED
510 Not Extended

See Also:
HTTP Extension Framework
Method Detail

values

public static HttpStatus[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (HttpStatus c : HttpStatus.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static HttpStatus valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

value

public int value()
Return the integer value of this status code.


series

public HttpStatus.Series series()
Returns the HTTP status series of this status code.

See Also:
HttpStatus.Series

toString

public String toString()
Return a string representation of this status code.

Overrides:
toString in class Enum<HttpStatus>

valueOf

public static HttpStatus valueOf(int statusCode)
Return the enum constant of this type with the specified numeric value.

Parameters:
statusCode - the numeric value of the enum to be returned
Returns:
the enum constant with the specified numeric value
Throws:
IllegalArgumentException - if this enum has no constant for the specified numeric value