@FunctionalInterface public interface ExchangeFunction
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));
Modifier and Type | Method and Description |
---|---|
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 . |
reactor.core.publisher.Mono<ClientResponse> exchange(ClientRequest request)
request
- the request to exchangedefault ExchangeFunction filter(ExchangeFilterFunction filter)
ExchangeFilterFunction
, resulting in a
filtered ExchangeFunction
.filter
- the filter to apply to this exchangeExchangeFilterFunction.apply(ExchangeFunction)