Interface ResponseListener


public interface ResponseListener
Listener to be provided when calling async performRequest methods provided by RestClient. Those methods that do accept a listener will return immediately, execute asynchronously, and notify the listener whenever the request yielded a response, or failed with an exception.

Note that it is not safe to call RestClient.close() from either of these callbacks.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onFailure​(Exception exception)
    Method invoked if the request failed.
    void
    onSuccess​(Response response)
    Method invoked if the request yielded a successful response
  • Method Details

    • onSuccess

      void onSuccess(Response response)
      Method invoked if the request yielded a successful response
    • onFailure

      void onFailure(Exception exception)
      Method invoked if the request failed. There are two main categories of failures: connection failures (usually IOExceptions, or responses that were treated as errors based on their error response code (ResponseExceptions).