org.apache.hc.core5.http.message

## Class StatusLine

- java.lang.Object
- - org.apache.hc.core5.http.message.StatusLine

- All Implemented Interfaces:
    Serializable

      @Contract(threading=IMMUTABLE)
      public final class StatusLine
      extends Object
      implements Serializable

  HTTP/1.1 status line.
  Since:
    4.0
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `StatusLine.StatusClass` Standard classes of HTTP status codes, plus `OTHER` for non-standard codes.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StatusLine(HttpResponse response)`
    `StatusLine(ProtocolVersion version, int statusCode, String reasonPhrase)` Creates a new status line with the given version, status, and reason.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ProtocolVersion` | `getProtocolVersion()`
    `String` | `getReasonPhrase()`
    `StatusLine.StatusClass` | `getStatusClass()`
    `int` | `getStatusCode()`
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### StatusLine

          public StatusLine(HttpResponse response)

    - #### StatusLine

          public StatusLine(ProtocolVersion version,
                    int statusCode,
                    String reasonPhrase)

      Creates a new status line with the given version, status, and reason.
      Parameters:
        `version` - the protocol version of the response
        `statusCode` - the status code of the response
        `reasonPhrase` - the reason phrase to the status code, or `null`

  - ### Method Detail

    - #### getStatusCode

          public int getStatusCode()

    - #### getStatusClass

          public StatusLine.StatusClass getStatusClass()

    - #### getProtocolVersion

          public ProtocolVersion getProtocolVersion()

    - #### getReasonPhrase

          public String getReasonPhrase()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.