Meta information about a resource.
This is basically the head of the HTTP message: the status code, the reason phrase, and the headers. In the application level callbacks, a reference to an instance of this class can be found in every resource. For example, given the following odd response from the server:
HTTP1.1 200 OK
Content-Type: application/json; charset=UTF-8
{
"error": {
"error_code": "BAD_REQUEST",
"error_message": "The value of foo cannot be bar"
}
}
The application callback will be called with an instance of Resource as the first parameter:
{ response ->
assert response instanceof fi.linuxbox.upcloud.core.Resource
assert response.META.status == 200
assert response.META.message == "OK"
assert response.error instanceof fi.linuxbox.upcloud.resource.Error
assert response.error.errorCode == "BAD_REQUEST"
assert response.error.errorMessage == "The value of foo cannot be bar"
}