Class HttpResponse

java.lang.Object
esendex.sdk.java.http.HttpResponse

public class HttpResponse extends Object
Container for HTTP responses. Holds the status code, status message and any content from an HTTP response.
Author:
Mike Whittaker
  • Constructor Details

    • HttpResponse

      public HttpResponse(int statusCode, String statusMessage, String content)
      Constructs an HttpResponse object.
      Parameters:
      statusCode - the HTTP status code to set
      statusMessage - the HTTP status message to set
      content - the content (if any) to set.
  • Method Details

    • isHttpOkay

      public boolean isHttpOkay()
      Convenience method for determining if getStatusCode() returns an OK response such that 200 invalid input: '<'= x invalid input: '<'= 299.
      Returns:
      true if response is OK otherwise false.
    • getStatusCode

      public int getStatusCode()
      Gets the status code.
      Returns:
      the status code
    • getStatusMessage

      public String getStatusMessage()
      Gets the status message.
      Returns:
      the status message
    • getContent

      public String getContent()
      Gets the content.
      Returns:
      the content
    • toString

      public String toString()
      Overrides:
      toString in class Object