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 enumStandard classes of HTTP status codes, plusOTHERfor non-standard codes. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ProtocolVersionThe protocol version.private final StringThe reason phrase.private static final longprivate final StatusLine.StatusClassThe status code class.private final intThe 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 TypeMethodDescriptionintbooleanWhether this status code is in the HTTP seriesStatusLine.StatusClass.CLIENT_ERROR.booleanisError()Whether this status code is in the HTTP seriesStatusLine.StatusClass.CLIENT_ERRORorStatusLine.StatusClass.SERVER_ERROR.booleanWhether this status code is in the HTTP seriesStatusLine.StatusClass.INFORMATIONAL.booleanWhether this status code is in the HTTP seriesStatusLine.StatusClass.REDIRECTION.booleanWhether this status code is in the HTTP seriesStatusLine.StatusClass.SERVER_ERROR.booleanWhether 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_ERRORorStatusLine.StatusClass.SERVER_ERROR.- Since:
- 5.1
-
getProtocolVersion
-
getReasonPhrase
-
toString
-