Class HttpStatus

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

public class HttpStatus extends Object

Http Status Codes

See Also:
  • Field Details

  • Constructor Details

    • HttpStatus

      public HttpStatus()
  • Method Details

    • 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.
    • hasNoBody

      public static boolean hasNoBody(int status)
    • 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 7231 - HTTP/1.1.
      Parameters:
      code - the code to test.
      Returns:
      true if within range of codes that belongs to Informational messages.
    • isInterim

      public static boolean isInterim(int code)
      Tests whether the status code is informational but not 101 Switching Protocols.
      Parameters:
      code - the code to test
      Returns:
      whether the status code is informational but not 101 Switching Protocols
    • 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 7231 - 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 7231 - 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 7231 - 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 7231 - HTTP/1.1.
      Parameters:
      code - the code to test.
      Returns:
      true if within range of codes that belongs to Server Error messages.