Merge pull request #31917 from ghkim3221
* pr/31917: Polish "Fix usage of WebClientAdapter in reference documentation" Fix usage of WebClientAdapter in reference documentation Closes gh-31917
This commit is contained in:
commit
28e5468162
|
|
@ -906,8 +906,8 @@ For `WebClient`:
|
||||||
|
|
||||||
[source,java,indent=0,subs="verbatim,quotes"]
|
[source,java,indent=0,subs="verbatim,quotes"]
|
||||||
----
|
----
|
||||||
WebClient client = WebClient.builder().baseUrl("https://api.github.com/").build();
|
WebClient webClient = WebClient.builder().baseUrl("https://api.github.com/").build();
|
||||||
WebClientAdapter adapter = WebClientAdapter.forClient(webClient)
|
WebClientAdapter adapter = WebClientAdapter.create(webClient);
|
||||||
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(adapter).build();
|
HttpServiceProxyFactory factory = HttpServiceProxyFactory.builderFor(adapter).build();
|
||||||
|
|
||||||
RepositoryService service = factory.createClient(RepositoryService.class);
|
RepositoryService service = factory.createClient(RepositoryService.class);
|
||||||
|
|
@ -1090,7 +1090,7 @@ responses performed through the client:
|
||||||
.defaultStatusHandler(HttpStatusCode::isError, resp -> ...)
|
.defaultStatusHandler(HttpStatusCode::isError, resp -> ...)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
WebClientAdapter clientAdapter = WebClientAdapter.forClient(webClient);
|
WebClientAdapter clientAdapter = WebClientAdapter.create(webClient);
|
||||||
HttpServiceProxyFactory factory = HttpServiceProxyFactory
|
HttpServiceProxyFactory factory = HttpServiceProxyFactory
|
||||||
.builder(clientAdapter).build();
|
.builder(clientAdapter).build();
|
||||||
----
|
----
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue