Made some updates to how Responses
are managed so it will always be available for inspection after a request has been made. Responses now contain the following information
code
the response code from the server. Default is-1
.data
json data received from the server. Default isnull
.exception
the exception object that occurred during the request. Default isnull
.
Note: If the exception is not-null you may still be able to retrieve the response code depending on when the exception occurred. However, data is always received last during the request so any exception will have prevented the collection of data.
Requests now verify the server response by checking for the expected response code and data.
Updated unit tests to provide more coverage.