Class HttpStatusLine


  • public final class HttpStatusLine
    extends Object
    The first line in an HTTP 1.0/1.1 response. Consists of the HTTP protocol version, status code, and a reason phrase for the HTTP response.
    See Also:
    RFC 2616
    • Method Detail

      • create

        public static HttpStatusLine create​(String line)
        Parses the provided statusLine into an HTTP status line.
        Parameters:
        line - Line to parse into an HTTP status line.
        Returns:
        A new instance of HttpStatusLine representing the given statusLine.
        Throws:
        IllegalArgumentException - if line is not the correct format of an HTTP status line. If it does not have a protocol version, status code, or reason component. Or, if the HTTP protocol version cannot be parsed.
      • getProtocolVersion

        public String getProtocolVersion()
        Gets the HTTP protocol version.
        Returns:
        The HTTP protocol version.
      • getStatusCode

        public int getStatusCode()
        Gets the HTTP status code.
        Returns:
        The HTTP status code.
      • getReason

        public String getReason()
        Gets the textual representation for the HTTP status code.
        Returns:
        The textual representation for the HTTP status code.