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
-
-
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()
-
-
-
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
-
-