Package org.apache.hc.core5.http.message
Class StatusLine
java.lang.Object
org.apache.hc.core5.http.message.StatusLine
- All Implemented Interfaces:
Serializable
HTTP/1.1 status line.
- Since:
- 4.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Standard classes of HTTP status codes, plusOTHER
for non-standard codes. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ProtocolVersion
The protocol version.private final String
The reason phrase.private static final long
private final StatusLine.StatusClass
The status code class.private final int
The status code. -
Constructor Summary
ConstructorsConstructorDescriptionStatusLine
(HttpResponse response) StatusLine
(ProtocolVersion version, int statusCode, String reasonPhrase) Creates a new status line with the given version, status, and reason. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
Whether this status code is in the HTTP seriesStatusLine.StatusClass.CLIENT_ERROR
.boolean
isError()
Whether this status code is in the HTTP seriesStatusLine.StatusClass.CLIENT_ERROR
orStatusLine.StatusClass.SERVER_ERROR
.boolean
Whether this status code is in the HTTP seriesStatusLine.StatusClass.INFORMATIONAL
.boolean
Whether this status code is in the HTTP seriesStatusLine.StatusClass.REDIRECTION
.boolean
Whether this status code is in the HTTP seriesStatusLine.StatusClass.SERVER_ERROR
.boolean
Whether this status code is in the HTTP seriesStatusLine.StatusClass.SUCCESSFUL
.toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
protoVersion
The protocol version. -
statusCode
private final int statusCodeThe status code. -
statusClass
The status code class. -
reasonPhrase
The reason phrase.
-
-
Constructor Details
-
StatusLine
-
StatusLine
Creates a new status line with the given version, status, and reason.- Parameters:
version
- the protocol version of the responsestatusCode
- the status code of the responsereasonPhrase
- the reason phrase to the status code, ornull
-
-
Method Details
-
getStatusCode
public int getStatusCode() -
getStatusClass
-
isInformational
public boolean isInformational()Whether this status code is in the HTTP seriesStatusLine.StatusClass.INFORMATIONAL
.- Since:
- 5.1
-
isSuccessful
public boolean isSuccessful()Whether this status code is in the HTTP seriesStatusLine.StatusClass.SUCCESSFUL
.- Since:
- 5.1
-
isRedirection
public boolean isRedirection()Whether this status code is in the HTTP seriesStatusLine.StatusClass.REDIRECTION
.- Since:
- 5.1
-
isClientError
public boolean isClientError()Whether this status code is in the HTTP seriesStatusLine.StatusClass.CLIENT_ERROR
.- Since:
- 5.1
-
isServerError
public boolean isServerError()Whether this status code is in the HTTP seriesStatusLine.StatusClass.SERVER_ERROR
.- Since:
- 5.1
-
isError
public boolean isError()Whether this status code is in the HTTP seriesStatusLine.StatusClass.CLIENT_ERROR
orStatusLine.StatusClass.SERVER_ERROR
.- Since:
- 5.1
-
getProtocolVersion
-
getReasonPhrase
-
toString
-