Interface RestCallInterceptor

All Known Implementing Classes:

public interface RestCallInterceptor
Used to intercept http connection responses to allow modification of that response before processing and for listening for call lifecycle events.

The BasicRestCallInterceptor is provided as an adapter class for implementing this interface.

Note that the RestClient class itself implements this interface so you can achieve the same results by overriding the methods on the client class as well.


// Specialized client that adds a header to every request. public class MyRestClient extends RestClient { @Override public void onInit(RestRequest req) { req.header("Foo", "bar"); } } // Instantiate the client. MyRestClient client = RestClient .create() .json() .build(MyRestClient.class);

See Also:
  • Method Summary

    Modifier and Type
    Called when the response body is consumed.
    Called immediately after an HTTP response has been received.
    Called immediately after RestRequest object is created and all headers/query/form-data has been copied from the client to the request object.