This protocol is used by the
request class to notify listeners when there are incoming HTTP responses and/or network errors.
onResponse is called if there is any response from the server, while
onError is called if the request never gets sent or if there is no response from the server.
Server responses can include successful returns, or return codes such as 404 (not found) - i.e. an error code returned from a server would be sent via the code parameter in
onResponse.