org.springframework.web.client

## Interface AsyncRequestCallback

-     public interface AsyncRequestCallback

  Callback interface for code that operates on an `AsyncClientHttpRequest`. Allows to manipulate the request headers, and write to the request body.

  Used internally by the `AsyncRestTemplate`, but also useful for application code.

  Since:
    4.0
  Author:
    Arjen Poutsma
  See Also:
    `AsyncRestTemplate.execute(java.lang.String, org.springframework.http.HttpMethod, org.springframework.web.client.AsyncRequestCallback, org.springframework.web.client.ResponseExtractor<T>, java.lang.Object...)`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `doWithRequest(AsyncClientHttpRequest request)` Gets called by `AsyncRestTemplate.execute(java.lang.String, org.springframework.http.HttpMethod, org.springframework.web.client.AsyncRequestCallback, org.springframework.web.client.ResponseExtractor<T>, java.lang.Object...)` with an opened `ClientHttpRequest`.

- - ### Method Detail

    - #### doWithRequest

          void doWithRequest(AsyncClientHttpRequest request)
                      throws IOException

      Gets called by `AsyncRestTemplate.execute(java.lang.String, org.springframework.http.HttpMethod, org.springframework.web.client.AsyncRequestCallback, org.springframework.web.client.ResponseExtractor<T>, java.lang.Object...)` with an opened `ClientHttpRequest`. Does not need to care about closing the request or about handling errors: this will all be handled by the `RestTemplate`.
      Parameters:
        `request` - the active HTTP request
      Throws:
        `IOException` - in case of I/O errors