-
Notifications
You must be signed in to change notification settings - Fork 16
Listeners
The library provides two types of listeners out of box.
-
OnResponseListener : This interface to be consumed by the client, to get callbacks on success/failure cases. It is more of a generic listener, where if server gives back any response, onResponseSuccess gets called, independent of the status code. When there is no response, or any error before server responds onResponseError gets called. If the client wants callback more specific to server status code such as 2XX, 3XX, 4XX and 5XX, implement the ForwardingResponse.
-
OnStatusCodeAwareResponseListener : This interface to be consumed by the client, to get callbacks on success/failure cases. Instead of giving a more generic callback, it gives two different callbacks based on the status code. If the status code is 2XX or 3XX, onResponseServerSuccess gets called with the RequestStats, and if the status code is 4XX or 5XX, onResponseServerError gets called with the RequestStats.