提交 f9e1913e 编写于 作者: A Arjen Poutsma

Added docs on customizing WebClient

Issue: SPR-15778
上级 9d8e3d41
...@@ -96,15 +96,21 @@ Mono<Account> account = client.get() ...@@ -96,15 +96,21 @@ Mono<Account> account = client.get()
.flatMap(response -> response.bodyToMono(Account.class)); .flatMap(response -> response.bodyToMono(Account.class));
---- ----
As stated above, `WebClient` requires a `ClientHttpConnector` to operate, the default being the `ReactorClientHttpConnector`.
When constructing a `ReactorClientHttpConnector`, you can use the `HttpClientOptions.Builder` to further customize it.
For instance, to customize the Netty `SslContext`:
[NOTE] [source,java,indent=0]
==== [subs="verbatim,quotes"]
The `AsyncRestTemplate` also supports non-blocking interactions. The main difference ----
is it can't support non-blocking streaming, like for example SslContext sslContext = ...
https://dev.twitter.com/streaming/overview[Twitter one], because fundamentally it's ReactorClientHttpConnector connector = new ReactorClientHttpConnector(builder -> {
still based and relies on `InputStream` and `OutputStream`. builder.sslContext(sslContext);
==== });
WebClient webClient = WebClient.builder()
.clientConnector(connector)
.build();
----
[[webflux-http-body]] [[webflux-http-body]]
== Request and Response Body Conversion == Request and Response Body Conversion
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册