Interface AsyncClientHttpRequestInterceptor

    • Method Detail

      • intercept

        ListenableFuture<ClientHttpResponse> intercept(HttpRequest request,
                                                       byte[] body,
                                                       AsyncClientHttpRequestExecution execution)
        Intercept the given request, and return a response future. The given AsyncClientHttpRequestExecution allows the interceptor to pass on the request to the next entity in the chain.

        An implementation might follow this pattern:

        1. Examine the request and body
        2. Optionally wrap the request to filter HTTP attributes.
        3. Optionally modify the body of the request.
        4. One of the following:
        5. Optionally adapt the response to filter HTTP attributes with the help of ListenableFutureAdapter.
        request - the request, containing method, URI, and headers
        body - the body of the request
        execution - the request execution
        the response future
        Throws: - in case of I/O errors