diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ExchangeFunction.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ExchangeFunction.java index 7152e60a43..79fe6f708c 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ExchangeFunction.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ExchangeFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,10 +24,13 @@ import reactor.core.publisher.Mono; * *
For example: *
- * ExchangeFunction exchangeFunction = ExchangeFunctions.create(new ReactorClientHttpConnector());
- * ClientRequest request = ClientRequest.create(HttpMethod.GET, URI.create("https://example.com/resource")).build();
+ * ExchangeFunction exchangeFunction =
+ * ExchangeFunctions.create(new ReactorClientHttpConnector());
*
- * Mono<String> result = exchangeFunction
+ * URI url = URI.create("https://example.com/resource");
+ * ClientRequest request = ClientRequest.create(HttpMethod.GET, url).build();
+ *
+ * Mono<String> bodyMono = exchangeFunction
* .exchange(request)
* .flatMap(response -> response.bodyToMono(String.class));
*
@@ -39,15 +42,15 @@ import reactor.core.publisher.Mono;
public interface ExchangeFunction {
/**
- * Exchange the given request for a response mono.
+ * Exchange the given request for a {@link ClientResponse} promise.
* @param request the request to exchange
* @return the delayed response
*/
Mono