org.springframework.http.client

## Interface AsyncClientHttpRequestInterceptor

- Deprecated.
  as of Spring 5.0, in favor of `ExchangeFilterFunction`

      @Deprecated
      public interface AsyncClientHttpRequestInterceptor

  Intercepts client-side HTTP requests. Implementations of this interface can be registered with the `AsyncRestTemplate` as to modify the outgoing `HttpRequest` and/or register to modify the incoming `ClientHttpResponse` with help of a `ListenableFutureAdapter`.

  The main entry point for interceptors is `intercept(org.springframework.http.HttpRequest, byte[], org.springframework.http.client.AsyncClientHttpRequestExecution)`.

  Since:
    4.3
  Author:
    Jakub Narloch, Rossen Stoyanchev
  See Also:
    `AsyncRestTemplate`, `InterceptingAsyncHttpAccessor`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `ListenableFuture<ClientHttpResponse>` | `intercept(HttpRequest request, byte[] body, AsyncClientHttpRequestExecution execution)` Deprecated. Intercept the given request, and return a response future.

- - ### Method Detail

    - #### intercept

          ListenableFuture<ClientHttpResponse> intercept(HttpRequest request,
                                                         byte[] body,
                                                         AsyncClientHttpRequestExecution execution)
                                                  throws 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:
         - execute the request through `ClientHttpRequestExecution`
         - don't execute the request to block the execution altogether
      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:
        `IOException` - in case of I/O errors