An instance of this class is a HTTP response received by the server or a generic error response. More...
Public Member Functions | |
Response (int status, String msg, String body) | |
boolean | isCompleted () |
boolean | isSuccess () |
boolean | isPartial () |
boolean | isFailed () |
boolean | isMultiple () |
int | getStatus () |
String | getMsg () |
String | getBody () |
Object | getBodyAsJson () |
String | getBodyAsString () |
Response [] | getMultiple () |
String | toString () |
Static Public Attributes | |
static final int | STATUS_OK = 200 |
static final int | STATUS_CREATED = 201 |
static final int | STATUS_PARTIAL = 206 |
static final int | STATUS_MULTI = 207 |
static final int | ERR_BAD_REQUEST = 400 |
static final int | ERR_UNAUTHORIZED = 401 |
static final int | ERR_PAYMENT_REQUIRED = 402 |
static final int | ERR_FORBIDDEN = 403 |
static final int | ERR_NOT_FOUND = 404 |
static final int | ERR_NOT_ALLOWED = 405 |
static final int | ERR_NOT_ACCEPTABLE = 406 |
static final int | ERR_INTERNAL = 500 |
static final int | ERR_NOT_IMPLEMENTED = 501 |
static final int | ERR_BAD_GATEWAY = 502 |
static final int | ERR_UNAVAILABLE = 503 |
An instance of this class is a HTTP response received by the server or a generic error response.
Response | ( | int | status, |
String | msg, | ||
String | body | ||
) |
Create a new HTTP response.
status | the received HTTP status code or an integer less that zero for unknown response |
msg | the message of the status code |
body | the received body of this response |
String getBody | ( | ) |
HTTP body getter.
Object getBodyAsJson | ( | ) |
HTTP body getter as JSON instance.
String getBodyAsString | ( | ) |
HTTP body getter as a decoded JSON string value.
RestException | if the response body is not null and if it is a JSON string value |
String getMsg | ( | ) |
HTTP status message getter.
Response [] getMultiple | ( | ) |
Helper method to obtain an array of more responses.
RestException | on error when decoding the JSON body of this response |
int getStatus | ( | ) |
HTTP status code getter.
boolean isCompleted | ( | ) |
boolean isFailed | ( | ) |
boolean isMultiple | ( | ) |
boolean isPartial | ( | ) |
boolean isSuccess | ( | ) |
String toString | ( | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Successful HTTP status code for creation requests
|
static |
Another partial successful HTTP status code
|
static |
Successful HTTP status code for generic requests
|
static |
Partial successful HTTP status code