org.eclipse.jetty.http

## Class HttpStatus

- java.lang.Object
- - org.eclipse.jetty.http.HttpStatus

-     public class HttpStatus
      extends Object

  HttpStatusCode enum class, for status codes based on various HTTP RFCs. (see table below)

  Enum | Code | Message | RFC 1945 - HTTP/1.0 | RFC 2616 - HTTP/1.1 | RFC 2518 - WEBDAV
  --- | --- | --- | --- | --- | ---
  `Informational - 1xx` | `isInformational(int)`
  `CONTINUE_100` | 100 | Continue |  | Sec. 10.1.1 |
  `SWITCHING_PROTOCOLS_101` | 101 | Switching Protocols |  | Sec. 10.1.2 |
  `PROCESSING_102` | 102 | Processing |  |  | Sec. 10.1
  `Success - 2xx` | `isSuccess(int)`
  `OK_200` | 200 | OK | Sec. 9.2 | Sec. 10.2.1 |
  `CREATED_201` | 201 | Created | Sec. 9.2 | Sec. 10.2.2 |
  `ACCEPTED_202` | 202 | Accepted | Sec. 9.2 | Sec. 10.2.3 |
  `NON_AUTHORITATIVE_INFORMATION_203` | 203 | Non Authoritative Information |  | Sec. 10.2.4 |
  `NO_CONTENT_204` | 204 | No Content | Sec. 9.2 | Sec. 10.2.5 |
  `RESET_CONTENT_205` | 205 | Reset Content |  | Sec. 10.2.6 |
  `PARTIAL_CONTENT_206` | 206 | Partial Content |  | Sec. 10.2.7 |
  `MULTI_STATUS_207` | 207 | Multi-Status |  |  | Sec. 10.2
  | 207 | Partial Update OK |  | draft/01 |
  `Redirection - 3xx` | `isRedirection(int)`
  `MULTIPLE_CHOICES_300` | 300 | Multiple Choices | Sec. 9.3 | Sec. 10.3.1 |
  `MOVED_PERMANENTLY_301` | 301 | Moved Permanently | Sec. 9.3 | Sec. 10.3.2 |
  `MOVED_TEMPORARILY_302` | 302 | Moved Temporarily | Sec. 9.3 | (now "`302 Found`") |
  `FOUND_302` | 302 | Found | (was "`302 Moved Temporarily`") | Sec. 10.3.3 |
  `SEE_OTHER_303` | 303 | See Other |  | Sec. 10.3.4 |
  `NOT_MODIFIED_304` | 304 | Not Modified | Sec. 9.3 | Sec. 10.3.5 |
  `USE_PROXY_305` | 305 | Use Proxy |  | Sec. 10.3.6 |
  | 306 | (Unused) |  | Sec. 10.3.7 |
  `TEMPORARY_REDIRECT_307` | 307 | Temporary Redirect |  | Sec. 10.3.8 |
  `Client Error - 4xx` | `isClientError(int)`
  `BAD_REQUEST_400` | 400 | Bad Request | Sec. 9.4 | Sec. 10.4.1 |
  `UNAUTHORIZED_401` | 401 | Unauthorized | Sec. 9.4 | Sec. 10.4.2 |
  `PAYMENT_REQUIRED_402` | 402 | Payment Required | Sec. 9.4 | Sec. 10.4.3 |
  `FORBIDDEN_403` | 403 | Forbidden | Sec. 9.4 | Sec. 10.4.4 |
  `NOT_FOUND_404` | 404 | Not Found | Sec. 9.4 | Sec. 10.4.5 |
  `METHOD_NOT_ALLOWED_405` | 405 | Method Not Allowed |  | Sec. 10.4.6 |
  `NOT_ACCEPTABLE_406` | 406 | Not Acceptable |  | Sec. 10.4.7 |
  `PROXY_AUTHENTICATION_REQUIRED_407` | 407 | Proxy Authentication Required |  | Sec. 10.4.8 |
  `REQUEST_TIMEOUT_408` | 408 | Request Timeout |  | Sec. 10.4.9 |
  `CONFLICT_409` | 409 | Conflict |  | Sec. 10.4.10 |
  `GONE_410` | 410 | Gone |  | Sec. 10.4.11 |
  `LENGTH_REQUIRED_411` | 411 | Length Required |  | Sec. 10.4.12 |
  `PRECONDITION_FAILED_412` | 412 | Precondition Failed |  | Sec. 10.4.13 |
  `REQUEST_ENTITY_TOO_LARGE_413` | 413 | Request Entity Too Large |  | Sec. 10.4.14 |
  `REQUEST_URI_TOO_LONG_414` | 414 | Request-URI Too Long |  | Sec. 10.4.15 |
  `UNSUPPORTED_MEDIA_TYPE_415` | 415 | Unsupported Media Type |  | Sec. 10.4.16 |
  `REQUESTED_RANGE_NOT_SATISFIABLE_416` | 416 | Requested Range Not Satisfiable |  | Sec. 10.4.17 |
  `EXPECTATION_FAILED_417` | 417 | Expectation Failed |  | Sec. 10.4.18 |
  | 418 | Reauthentication Required |  | draft/01 |
  | 418 | Unprocessable Entity |  |  | draft/05
  | 419 | Proxy Reauthentication Required |  | draft/01 |
  | 419 | Insufficient Space on Resource |  |  | draft/05
  | 420 | Method Failure |  |  | draft/05
  | 421 | (Unused) |  |  |
  `UNPROCESSABLE_ENTITY_422` | 422 | Unprocessable Entity |  |  | Sec. 10.3
  `LOCKED_423` | 423 | Locked |  |  | Sec. 10.4
  `FAILED_DEPENDENCY_424` | 424 | Failed Dependency |  |  | Sec. 10.5
  `Server Error - 5xx` | `isServerError(int)`
  `INTERNAL_SERVER_ERROR_500` | 500 | Internal Server Error | Sec. 9.5 | Sec. 10.5.1 |
  `NOT_IMPLEMENTED_501` | 501 | Not Implemented | Sec. 9.5 | Sec. 10.5.2 |
  `BAD_GATEWAY_502` | 502 | Bad Gateway | Sec. 9.5 | Sec. 10.5.3 |
  `SERVICE_UNAVAILABLE_503` | 503 | Service Unavailable | Sec. 9.5 | Sec. 10.5.4 |
  `GATEWAY_TIMEOUT_504` | 504 | Gateway Timeout |  | Sec. 10.5.5 |
  `HTTP_VERSION_NOT_SUPPORTED_505` | 505 | HTTP Version Not Supported |  | Sec. 10.5.6 |
  | 506 | (Unused) |  |  |
  `INSUFFICIENT_STORAGE_507` | 507 | Insufficient Storage |  |  | Sec. 10.6

  Version:
    $Id$

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `HttpStatus.Code`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ACCEPTED_202`
    `static int` | `BAD_GATEWAY_502`
    `static int` | `BAD_REQUEST_400`
    `static int` | `CONFLICT_409`
    `static int` | `CONTINUE_100`
    `static int` | `CREATED_201`
    `static int` | `EXPECTATION_FAILED_417`
    `static int` | `FAILED_DEPENDENCY_424`
    `static int` | `FORBIDDEN_403`
    `static int` | `FOUND_302`
    `static int` | `GATEWAY_TIMEOUT_504`
    `static int` | `GONE_410`
    `static int` | `HTTP_VERSION_NOT_SUPPORTED_505`
    `static int` | `INSUFFICIENT_STORAGE_507`
    `static int` | `INTERNAL_SERVER_ERROR_500`
    `static int` | `LENGTH_REQUIRED_411`
    `static int` | `LOCKED_423`
    `static int` | `MAX_CODE`
    `static int` | `METHOD_NOT_ALLOWED_405`
    `static int` | `MOVED_PERMANENTLY_301`
    `static int` | `MOVED_TEMPORARILY_302`
    `static int` | `MULTI_STATUS_207`
    `static int` | `MULTIPLE_CHOICES_300`
    `static int` | `NO_CONTENT_204`
    `static int` | `NON_AUTHORITATIVE_INFORMATION_203`
    `static int` | `NOT_ACCEPTABLE_406`
    `static int` | `NOT_FOUND_404`
    `static int` | `NOT_IMPLEMENTED_501`
    `static int` | `NOT_MODIFIED_304`
    `static int` | `OK_200`
    `static int` | `PARTIAL_CONTENT_206`
    `static int` | `PAYMENT_REQUIRED_402`
    `static int` | `PRECONDITION_FAILED_412`
    `static int` | `PROCESSING_102`
    `static int` | `PROXY_AUTHENTICATION_REQUIRED_407`
    `static int` | `REQUEST_ENTITY_TOO_LARGE_413`
    `static int` | `REQUEST_TIMEOUT_408`
    `static int` | `REQUEST_URI_TOO_LONG_414`
    `static int` | `REQUESTED_RANGE_NOT_SATISFIABLE_416`
    `static int` | `RESET_CONTENT_205`
    `static int` | `SEE_OTHER_303`
    `static int` | `SERVICE_UNAVAILABLE_503`
    `static int` | `SWITCHING_PROTOCOLS_101`
    `static int` | `TEMPORARY_REDIRECT_307`
    `static int` | `UNAUTHORIZED_401`
    `static int` | `UNPROCESSABLE_ENTITY_422`
    `static int` | `UNSUPPORTED_MEDIA_TYPE_415`
    `static int` | `USE_PROXY_305`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpStatus()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static HttpStatus.Code` | `getCode(int code)` Get the HttpStatusCode for a specific code
    `static String` | `getMessage(int code)` Get the status message for a specific code.
    `static boolean` | `isClientError(int code)` Simple test against an code to determine if it falls into the `Client Error` message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
    `static boolean` | `isInformational(int code)` Simple test against an code to determine if it falls into the `Informational` message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
    `static boolean` | `isRedirection(int code)` Simple test against an code to determine if it falls into the `Redirection` message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
    `static boolean` | `isServerError(int code)` Simple test against an code to determine if it falls into the `Server Error` message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
    `static boolean` | `isSuccess(int code)` Simple test against an code to determine if it falls into the `Success` message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### CONTINUE_100

          public static final int CONTINUE_100

      See Also:
        Constant Field Values

    - #### SWITCHING_PROTOCOLS_101

          public static final int SWITCHING_PROTOCOLS_101

      See Also:
        Constant Field Values

    - #### PROCESSING_102

          public static final int PROCESSING_102

      See Also:
        Constant Field Values

    - #### OK_200

          public static final int OK_200

      See Also:
        Constant Field Values

    - #### CREATED_201

          public static final int CREATED_201

      See Also:
        Constant Field Values

    - #### ACCEPTED_202

          public static final int ACCEPTED_202

      See Also:
        Constant Field Values

    - #### NON_AUTHORITATIVE_INFORMATION_203

          public static final int NON_AUTHORITATIVE_INFORMATION_203

      See Also:
        Constant Field Values

    - #### NO_CONTENT_204

          public static final int NO_CONTENT_204

      See Also:
        Constant Field Values

    - #### RESET_CONTENT_205

          public static final int RESET_CONTENT_205

      See Also:
        Constant Field Values

    - #### PARTIAL_CONTENT_206

          public static final int PARTIAL_CONTENT_206

      See Also:
        Constant Field Values

    - #### MULTI_STATUS_207

          public static final int MULTI_STATUS_207

      See Also:
        Constant Field Values

    - #### MULTIPLE_CHOICES_300

          public static final int MULTIPLE_CHOICES_300

      See Also:
        Constant Field Values

    - #### MOVED_PERMANENTLY_301

          public static final int MOVED_PERMANENTLY_301

      See Also:
        Constant Field Values

    - #### MOVED_TEMPORARILY_302

          public static final int MOVED_TEMPORARILY_302

      See Also:
        Constant Field Values

    - #### FOUND_302

          public static final int FOUND_302

      See Also:
        Constant Field Values

    - #### SEE_OTHER_303

          public static final int SEE_OTHER_303

      See Also:
        Constant Field Values

    - #### NOT_MODIFIED_304

          public static final int NOT_MODIFIED_304

      See Also:
        Constant Field Values

    - #### USE_PROXY_305

          public static final int USE_PROXY_305

      See Also:
        Constant Field Values

    - #### TEMPORARY_REDIRECT_307

          public static final int TEMPORARY_REDIRECT_307

      See Also:
        Constant Field Values

    - #### BAD_REQUEST_400

          public static final int BAD_REQUEST_400

      See Also:
        Constant Field Values

    - #### UNAUTHORIZED_401

          public static final int UNAUTHORIZED_401

      See Also:
        Constant Field Values

    - #### PAYMENT_REQUIRED_402

          public static final int PAYMENT_REQUIRED_402

      See Also:
        Constant Field Values

    - #### FORBIDDEN_403

          public static final int FORBIDDEN_403

      See Also:
        Constant Field Values

    - #### NOT_FOUND_404

          public static final int NOT_FOUND_404

      See Also:
        Constant Field Values

    - #### METHOD_NOT_ALLOWED_405

          public static final int METHOD_NOT_ALLOWED_405

      See Also:
        Constant Field Values

    - #### NOT_ACCEPTABLE_406

          public static final int NOT_ACCEPTABLE_406

      See Also:
        Constant Field Values

    - #### PROXY_AUTHENTICATION_REQUIRED_407

          public static final int PROXY_AUTHENTICATION_REQUIRED_407

      See Also:
        Constant Field Values

    - #### REQUEST_TIMEOUT_408

          public static final int REQUEST_TIMEOUT_408

      See Also:
        Constant Field Values

    - #### CONFLICT_409

          public static final int CONFLICT_409

      See Also:
        Constant Field Values

    - #### GONE_410

          public static final int GONE_410

      See Also:
        Constant Field Values

    - #### LENGTH_REQUIRED_411

          public static final int LENGTH_REQUIRED_411

      See Also:
        Constant Field Values

    - #### PRECONDITION_FAILED_412

          public static final int PRECONDITION_FAILED_412

      See Also:
        Constant Field Values

    - #### REQUEST_ENTITY_TOO_LARGE_413

          public static final int REQUEST_ENTITY_TOO_LARGE_413

      See Also:
        Constant Field Values

    - #### REQUEST_URI_TOO_LONG_414

          public static final int REQUEST_URI_TOO_LONG_414

      See Also:
        Constant Field Values

    - #### UNSUPPORTED_MEDIA_TYPE_415

          public static final int UNSUPPORTED_MEDIA_TYPE_415

      See Also:
        Constant Field Values

    - #### REQUESTED_RANGE_NOT_SATISFIABLE_416

          public static final int REQUESTED_RANGE_NOT_SATISFIABLE_416

      See Also:
        Constant Field Values

    - #### EXPECTATION_FAILED_417

          public static final int EXPECTATION_FAILED_417

      See Also:
        Constant Field Values

    - #### UNPROCESSABLE_ENTITY_422

          public static final int UNPROCESSABLE_ENTITY_422

      See Also:
        Constant Field Values

    - #### LOCKED_423

          public static final int LOCKED_423

      See Also:
        Constant Field Values

    - #### FAILED_DEPENDENCY_424

          public static final int FAILED_DEPENDENCY_424

      See Also:
        Constant Field Values

    - #### INTERNAL_SERVER_ERROR_500

          public static final int INTERNAL_SERVER_ERROR_500

      See Also:
        Constant Field Values

    - #### NOT_IMPLEMENTED_501

          public static final int NOT_IMPLEMENTED_501

      See Also:
        Constant Field Values

    - #### BAD_GATEWAY_502

          public static final int BAD_GATEWAY_502

      See Also:
        Constant Field Values

    - #### SERVICE_UNAVAILABLE_503

          public static final int SERVICE_UNAVAILABLE_503

      See Also:
        Constant Field Values

    - #### GATEWAY_TIMEOUT_504

          public static final int GATEWAY_TIMEOUT_504

      See Also:
        Constant Field Values

    - #### HTTP_VERSION_NOT_SUPPORTED_505

          public static final int HTTP_VERSION_NOT_SUPPORTED_505

      See Also:
        Constant Field Values

    - #### INSUFFICIENT_STORAGE_507

          public static final int INSUFFICIENT_STORAGE_507

      See Also:
        Constant Field Values

    - #### MAX_CODE

          public static final int MAX_CODE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HttpStatus

          public HttpStatus()

  - ### Method Detail

    - #### getCode

          public static HttpStatus.Code getCode(int code)

      Get the HttpStatusCode for a specific code
      Parameters:
        `code` - the code to lookup.
      Returns:
        the `HttpStatus` if found, or null if not found.

    - #### getMessage

          public static String getMessage(int code)

      Get the status message for a specific code.
      Parameters:
        `code` - the code to look up
      Returns:
        the specific message, or the code number itself if code does not match known list.

    - #### isInformational

          public static boolean isInformational(int code)

      Simple test against an code to determine if it falls into the `Informational` message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
      Parameters:
        `code` - the code to test.
      Returns:
        true if within range of codes that belongs to `Informational` messages.

    - #### isSuccess

          public static boolean isSuccess(int code)

      Simple test against an code to determine if it falls into the `Success` message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
      Parameters:
        `code` - the code to test.
      Returns:
        true if within range of codes that belongs to `Success` messages.

    - #### isRedirection

          public static boolean isRedirection(int code)

      Simple test against an code to determine if it falls into the `Redirection` message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
      Parameters:
        `code` - the code to test.
      Returns:
        true if within range of codes that belongs to `Redirection` messages.

    - #### isClientError

          public static boolean isClientError(int code)

      Simple test against an code to determine if it falls into the `Client Error` message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
      Parameters:
        `code` - the code to test.
      Returns:
        true if within range of codes that belongs to `Client Error` messages.

    - #### isServerError

          public static boolean isServerError(int code)

      Simple test against an code to determine if it falls into the `Server Error` message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
      Parameters:
        `code` - the code to test.
      Returns:
        true if within range of codes that belongs to `Server Error` messages.

Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.