Package esendex.sdk.java.http
Class HttpResponse
java.lang.Object
esendex.sdk.java.http.HttpResponse
Container for HTTP responses. Holds the status code, status message and any
content from an HTTP response.
- Author:
- Mike Whittaker
-
Constructor Summary
ConstructorsConstructorDescriptionHttpResponse
(int statusCode, String statusMessage, String content) Constructs an HttpResponse object. -
Method Summary
Modifier and TypeMethodDescriptionGets the content.int
Gets the status code.Gets the status message.boolean
Convenience method for determining ifgetStatusCode()
returns an OK response such that 200 invalid input: '<'= x invalid input: '<'= 299.toString()
-
Constructor Details
-
HttpResponse
Constructs an HttpResponse object.- Parameters:
statusCode
- the HTTP status code to setstatusMessage
- the HTTP status message to setcontent
- the content (if any) to set.
-
-
Method Details
-
isHttpOkay
public boolean isHttpOkay()Convenience method for determining ifgetStatusCode()
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
Gets the status message.- Returns:
- the status message
-
getContent
Gets the content.- Returns:
- the content
-
toString
-