org.springframework.web.reactive.function.client

## Interface ExchangeFunction

Functional Interface:
  This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ExchangeFunction

Represents a function that exchanges a request for a (delayed) ClientResponse. Can be used as an alternative to `WebClient`.

For example:

     ExchangeFunction exchangeFunction = ExchangeFunctions.create(new ReactorClientHttpConnector());
     ClientRequest<Void> request = ClientRequest.method(HttpMethod.GET, "https://example.com/resource").build();

     Mono<String> result = exchangeFunction
         .exchange(request)
         .then(response -> response.bodyToMono(String.class));

Since:
  5.0
Author:
  Arjen Poutsma

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`reactor.core.publisher.Mono<ClientResponse>` `exchange(ClientRequest request)` Exchange the given request for a response mono.
`default ExchangeFunction` `filter(ExchangeFilterFunction filter)` Filters this exchange function with the given `ExchangeFilterFunction`, resulting in a filtered `ExchangeFunction`.

### Method Detail

#### exchange

    reactor.core.publisher.Mono<ClientResponse> exchange(ClientRequest request)

Exchange the given request for a response mono.

Parameters:
  `request` - the request to exchange
Returns:
  the delayed response

#### filter

    default ExchangeFunction filter(ExchangeFilterFunction filter)

Filters this exchange function with the given `ExchangeFilterFunction`, resulting in a filtered `ExchangeFunction`.

Parameters:
  `filter` - the filter to apply to this exchange
Returns:
  the filtered exchange
See Also:
  `ExchangeFilterFunction.apply(ExchangeFunction)`