Package com.neovisionaries.ws.client
Class StatusLine
java.lang.Object
com.neovisionaries.ws.client.StatusLine
HTTP status line returned from an HTTP server.
- Since:
- 1.19
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the HTTP version.Get the reason phrase.int
Get the status code.toString()
Get the string representation of this instance, which is equal to the raw status line.
-
Field Details
-
mHttpVersion
HTTP version. -
mStatusCode
private final int mStatusCodeStatus code. -
mReasonPhrase
Reason phrase. -
mString
String representation of this instance (= the raw status line).
-
-
Constructor Details
-
StatusLine
StatusLine(String line) Constructor with a raw status line.- Parameters:
line
- A status line.- Throws:
NullPointerException
-line
isnull
IllegalArgumentException
- The number of elements inline
is less than 2.NumberFormatException
- Failed to parse the second element inline
as an integer.
-
-
Method Details
-
getHttpVersion
Get the HTTP version.- Returns:
- The HTTP version. For example,
"HTTP/1.1"
.
-
getStatusCode
public int getStatusCode()Get the status code.- Returns:
- The status code. For example,
404
.
-
getReasonPhrase
Get the reason phrase.- Returns:
- The reason phrase. For example,
"Not Found"
.
-
toString
Get the string representation of this instance, which is equal to the raw status line.
-