Interface RestCallInterceptor

All Known Implementing Classes:
BasicRestCallInterceptor

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.

Example:

// 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
    Method
    Description
    void
    Called when the response body is consumed.
    void
    Called immediately after an HTTP response has been received.
    void
    Called immediately after RestRequest object is created and all headers/query/form-data has been copied from the client to the request object.