Enum HttpStatus

java.lang.Object
java.lang.Enum<HttpStatus>
org.apache.mina.http.api.HttpStatus
All Implemented Interfaces:
Serializable, Comparable<HttpStatus>

public enum HttpStatus extends Enum<HttpStatus>
An Enumeration of all known HTTP status codes.
  • Enum Constant Details

    • INFORMATIONAL_CONTINUE

      public static final HttpStatus INFORMATIONAL_CONTINUE
      100 - Continue
    • INFORMATIONAL_SWITCHING_PROTOCOLS

      public static final HttpStatus INFORMATIONAL_SWITCHING_PROTOCOLS
      101 - Switching Protocols
    • SUCCESS_OK

      public static final HttpStatus SUCCESS_OK
      200 - OK
    • SUCCESS_CREATED

      public static final HttpStatus SUCCESS_CREATED
      201 - Created
    • SUCCESS_ACCEPTED

      public static final HttpStatus SUCCESS_ACCEPTED
      202 - Accepted
    • SUCCESS_NON_AUTHORATIVE_INFORMATION

      public static final HttpStatus SUCCESS_NON_AUTHORATIVE_INFORMATION
      203 - Non-Authoritative Information
    • SUCCESS_NO_CONTENT

      public static final HttpStatus SUCCESS_NO_CONTENT
      204 - No Content
    • SUCCESS_RESET_CONTENT

      public static final HttpStatus SUCCESS_RESET_CONTENT
      205 - Reset Content
    • SUCCESS_PARTIAL_CONTENT

      public static final HttpStatus SUCCESS_PARTIAL_CONTENT
      206 - Created
    • REDIRECTION_MULTIPLE_CHOICES

      public static final HttpStatus REDIRECTION_MULTIPLE_CHOICES
      300 - Multiple Choices
    • REDIRECTION_MOVED_PERMANENTLY

      public static final HttpStatus REDIRECTION_MOVED_PERMANENTLY
      301 - Moved Permanently
    • REDIRECTION_FOUND

      public static final HttpStatus REDIRECTION_FOUND
      302 - Found / Moved Temporarily
    • REDIRECTION_SEE_OTHER

      public static final HttpStatus REDIRECTION_SEE_OTHER
      303 - See Others
    • REDIRECTION_NOT_MODIFIED

      public static final HttpStatus REDIRECTION_NOT_MODIFIED
      304 - Not Modified
    • REDIRECTION_USE_PROXY

      public static final HttpStatus REDIRECTION_USE_PROXY
      305 - Use Proxy
    • REDIRECTION_TEMPORARILY_REDIRECT

      public static final HttpStatus REDIRECTION_TEMPORARILY_REDIRECT
      307 - Temporary Redirect
    • CLIENT_ERROR_BAD_REQUEST

      public static final HttpStatus CLIENT_ERROR_BAD_REQUEST
      400 - Bad Request
    • CLIENT_ERROR_UNAUTHORIZED

      public static final HttpStatus CLIENT_ERROR_UNAUTHORIZED
      401 - Unauthorized
    • CLIENT_ERROR_FORBIDDEN

      public static final HttpStatus CLIENT_ERROR_FORBIDDEN
      403 - Forbidden
    • CLIENT_ERROR_NOT_FOUND

      public static final HttpStatus CLIENT_ERROR_NOT_FOUND
      404 - Not Found
    • CLIENT_ERROR_METHOD_NOT_ALLOWED

      public static final HttpStatus CLIENT_ERROR_METHOD_NOT_ALLOWED
      405 - Method Not Allowed
    • CLIENT_ERROR_NOT_ACCEPTABLE

      public static final HttpStatus CLIENT_ERROR_NOT_ACCEPTABLE
      406 - Not Acceptable
    • CLIENT_ERROR_PROXY_AUTHENTICATION_REQUIRED

      public static final HttpStatus CLIENT_ERROR_PROXY_AUTHENTICATION_REQUIRED
      407 - Proxy Authentication Required
    • CLIENT_ERROR_REQUEST_TIMEOUT

      public static final HttpStatus CLIENT_ERROR_REQUEST_TIMEOUT
      408 - Request Timeout
    • CLIENT_ERROR_CONFLICT

      public static final HttpStatus CLIENT_ERROR_CONFLICT
      409 - Conflict
    • CLIENT_ERROR_GONE

      public static final HttpStatus CLIENT_ERROR_GONE
      410 - Gone
    • CLIENT_ERROR_LENGTH_REQUIRED

      public static final HttpStatus CLIENT_ERROR_LENGTH_REQUIRED
      411 - Length Required
    • CLIENT_ERROR_PRECONDITION_FAILED

      public static final HttpStatus CLIENT_ERROR_PRECONDITION_FAILED
      412 - Precondition Failed
    • CLIENT_ERROR_REQUEST_ENTITY_TOO_LARGE

      public static final HttpStatus CLIENT_ERROR_REQUEST_ENTITY_TOO_LARGE
      413 - Request Entity Too Large
    • CLIENT_ERROR_REQUEST_URI_TOO_LONG

      public static final HttpStatus CLIENT_ERROR_REQUEST_URI_TOO_LONG
      414 - Bad Request
    • CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE

      public static final HttpStatus CLIENT_ERROR_UNSUPPORTED_MEDIA_TYPE
      415 - Unsupported Media Type
    • CLIENT_ERROR_REQUESTED_RANGE_NOT_SATISFIABLE

      public static final HttpStatus CLIENT_ERROR_REQUESTED_RANGE_NOT_SATISFIABLE
      416 - Requested Range Not Satisfiable
    • CLIENT_ERROR_EXPECTATION_FAILED

      public static final HttpStatus CLIENT_ERROR_EXPECTATION_FAILED
      417 - Expectation Failed
    • SERVER_ERROR_INTERNAL_SERVER_ERROR

      public static final HttpStatus SERVER_ERROR_INTERNAL_SERVER_ERROR
      500 - Internal Server Error
    • SERVER_ERROR_NOT_IMPLEMENTED

      public static final HttpStatus SERVER_ERROR_NOT_IMPLEMENTED
      501 - Not Implemented
    • SERVER_ERROR_BAD_GATEWAY

      public static final HttpStatus SERVER_ERROR_BAD_GATEWAY
      502 - Bad Gateway
    • SERVER_ERROR_SERVICE_UNAVAILABLE

      public static final HttpStatus SERVER_ERROR_SERVICE_UNAVAILABLE
      503 - Service Unavailable
    • SERVER_ERROR_GATEWAY_TIMEOUT

      public static final HttpStatus SERVER_ERROR_GATEWAY_TIMEOUT
      504 - Gateway Timeout
    • SERVER_ERROR_HTTP_VERSION_NOT_SUPPORTED

      public static final HttpStatus SERVER_ERROR_HTTP_VERSION_NOT_SUPPORTED
      505 - HTTP Version Not Supported
  • Field Details

    • code

      private int code
      The code associated with this status, for example "404" for "Not Found".
    • line

      private String line
      The line associated with this status, "HTTP/1.1 501 Not Implemented".
  • Constructor Details

    • HttpStatus

      private HttpStatus(int code, String phrase)
      Create an instance of this type.
      Parameters:
      code - the status code.
      phrase - the associated phrase.
  • Method Details

    • values

      public static HttpStatus[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      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
    • code

      public int code()
      Retrieve the status code for this instance.
      Returns:
      the status code.
    • line

      public String line()
      Retrieve the status line for this instance.
      Returns:
      the status line.