Class HttpResponseException

All Implemented Interfaces:
Serializable

public class HttpResponseException extends ClientProtocolException
Signals a non 2xx HTTP response.
Since:
4.0
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • statusCode

      private final int statusCode
    • reasonPhrase

      private final String reasonPhrase
    • contentBytes

      private final byte[] contentBytes
    • contentType

      private final org.apache.hc.core5.http.ContentType contentType
  • Constructor Details

    • HttpResponseException

      public HttpResponseException(int statusCode, String reasonPhrase)
      Constructs a new instance of HttpResponseException with the given status code and reason phrase, and no content bytes or content type.
      Parameters:
      statusCode - the HTTP status code
      reasonPhrase - 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 of HttpResponseException with the given status code, reason phrase, content bytes, and content type.
      Parameters:
      statusCode - the HTTP status code
      reasonPhrase - the reason phrase associated with the HTTP status code
      contentBytes - the content bytes of the HTTP response
      contentType - the content type of the HTTP response
  • Method Details

    • getStatusCode

      public int getStatusCode()
    • getReasonPhrase

      public String getReasonPhrase()
    • getContentBytes

      public byte[] getContentBytes()
    • getContentType

      public org.apache.hc.core5.http.ContentType getContentType()