Skip to content
Anirudh Ramanan edited this page Jul 15, 2016 · 1 revision

The library provides two types of listeners out of box.

  1. 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.

  2. 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.

Clone this wiki locally