Class HttpException

All Implemented Interfaces:
Serializable

public class HttpException extends RuntimeException
An exception that signals an error status while performing a HTTP request. When this exception is encountered it means the client successfully established the connection with the server, established any secure (https) session, and received an HTTP response from the server.
See Also:
  • Constructor Details

    • HttpException

      public HttpException(String method, URI uri, int status, String response)
      Create a new instance
      Parameters:
      method - An HTTP method used
      uri - A target url
      status - The HTTP response status code
      response - The HTTP response body
  • Method Details

    • getMethod

      public String getMethod()
      Get the HTTP method
      Returns:
      The HTTP method
    • getUri

      public URI getUri()
      Get the target url
      Returns:
      A URI object for the url
    • getStatus

      public int getStatus()
      Get the HTTP status
      Returns:
      A status code as int
    • getResponse

      public String getResponse()
      Get the HTTP response body
      Returns:
      A response body