public interface RestCallInterceptor
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.
Modifier and Type | Method and Description |
---|---|
void |
onClose(RestRequest req,
RestResponse res)
Called when the response body is consumed.
|
void |
onConnect(RestRequest req,
RestResponse res)
Called immediately after an HTTP response has been received.
|
void |
onInit(RestRequest req)
Called immediately after
RestRequest object is created and all headers/query/form-data has been
copied from the client to the request object. |
void onInit(RestRequest req) throws Exception
RestRequest
object is created and all headers/query/form-data has been
copied from the client to the request object.req
- The HTTP request object.Exception
- Any exception can be thrown.
RestCallException
or RuntimeException
, will be wrapped in a RestCallException
.void onConnect(RestRequest req, RestResponse res) throws Exception
req
- The HTTP request object.res
- The HTTP response object.Exception
- Any exception can be thrown.
RestCallException
or RuntimeException
, will be wrapped in a RestCallException
.void onClose(RestRequest req, RestResponse res) throws Exception
req
- The request object.res
- The response object.RestCallException
- Error occurred during call.Exception
- Any exception can be thrown.
RestCallException
or RuntimeException
, will be wrapped in a RestCallException
.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.