Package org.apache.hc.client5.http
Class HttpResponseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.apache.hc.client5.http.ClientProtocolException
org.apache.hc.client5.http.HttpResponseException
- All Implemented Interfaces:
Serializable
Signals a non 2xx HTTP response.
- Since:
- 4.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]
private final org.apache.hc.core5.http.ContentType
private final String
private static final long
private final int
-
Constructor Summary
ConstructorsConstructorDescriptionHttpResponseException
(int statusCode, String reasonPhrase) Constructs a new instance ofHttpResponseException
with the given status code and reason phrase, and no content bytes or content type.HttpResponseException
(int statusCode, String reasonPhrase, byte[] contentBytes, org.apache.hc.core5.http.ContentType contentType) Constructs a new instance ofHttpResponseException
with the given status code, reason phrase, content bytes, and content type. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
org.apache.hc.core5.http.ContentType
int
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
statusCode
private final int statusCode -
reasonPhrase
-
contentBytes
private final byte[] contentBytes -
contentType
private final org.apache.hc.core5.http.ContentType contentType
-
-
Constructor Details
-
HttpResponseException
Constructs a new instance ofHttpResponseException
with the given status code and reason phrase, and no content bytes or content type.- Parameters:
statusCode
- the HTTP status codereasonPhrase
- the reason phrase associated with the HTTP status code
-
HttpResponseException
public HttpResponseException(int statusCode, String reasonPhrase, byte[] contentBytes, org.apache.hc.core5.http.ContentType contentType) Constructs a new instance ofHttpResponseException
with the given status code, reason phrase, content bytes, and content type.- Parameters:
statusCode
- the HTTP status codereasonPhrase
- the reason phrase associated with the HTTP status codecontentBytes
- the content bytes of the HTTP responsecontentType
- the content type of the HTTP response
-
-
Method Details
-
getStatusCode
public int getStatusCode() -
getReasonPhrase
-
getContentBytes
public byte[] getContentBytes() -
getContentType
public org.apache.hc.core5.http.ContentType getContentType()
-