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:
java.io.Serializable
public class HttpResponseException extends ClientProtocolException
Signals a non 2xx HTTP response.- Since:
- 4.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]contentBytesprivate org.apache.hc.core5.http.ContentTypecontentTypeprivate java.lang.StringreasonPhraseprivate static longserialVersionUIDprivate intstatusCode
-
Constructor Summary
Constructors Constructor Description HttpResponseException(int statusCode, java.lang.String reasonPhrase)Constructs a new instance ofHttpResponseExceptionwith the given status code and reason phrase, and no content bytes or content type.HttpResponseException(int statusCode, java.lang.String reasonPhrase, byte[] contentBytes, org.apache.hc.core5.http.ContentType contentType)Constructs a new instance ofHttpResponseExceptionwith the given status code, reason phrase, content bytes, and content type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getContentBytes()org.apache.hc.core5.http.ContentTypegetContentType()java.lang.StringgetReasonPhrase()intgetStatusCode()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
statusCode
private final int statusCode
-
reasonPhrase
private final java.lang.String reasonPhrase
-
contentBytes
private final byte[] contentBytes
-
contentType
private final org.apache.hc.core5.http.ContentType contentType
-
-
Constructor Detail
-
HttpResponseException
public HttpResponseException(int statusCode, java.lang.String reasonPhrase)Constructs a new instance ofHttpResponseExceptionwith 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, java.lang.String reasonPhrase, byte[] contentBytes, org.apache.hc.core5.http.ContentType contentType)Constructs a new instance ofHttpResponseExceptionwith 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
-
-