Class HttpStatusLine


  • public final class HttpStatusLine
    extends java.lang.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 Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static HttpStatusLine create​(java.lang.String line)
      Parses the provided statusLine into an HTTP status line.
      java.lang.String getProtocolVersion()
      Gets the HTTP protocol version.
      java.lang.String getReason()
      Gets the textual representation for the HTTP status code.
      int getStatusCode()
      Gets the HTTP status code.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        public static HttpStatusLine create​(java.lang.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:
        java.lang.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 java.lang.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 java.lang.String getReason()
        Gets the textual representation for the HTTP status code.
        Returns:
        The textual representation for the HTTP status code.