org.springframework.http.client

Interface AsyncClientHttpRequestInterceptor

    • Method Detail

      • intercept

        ListenableFuture<ClientHttpResponse> intercept(HttpRequest request,
                                                       byte[] body,
                                                       AsyncClientHttpRequestExecution execution)
                                                throws java.io.IOException
        Deprecated. 
        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.
        Parameters:
        request - the request, containing method, URI, and headers
        body - the body of the request
        execution - the request execution
        Returns:
        the response future
        Throws:
        java.io.IOException - in case of I/O errors