Added docs on customizing WebClient

Issue: SPR-15778
This commit is contained in:
Arjen Poutsma
2017-09-26 14:06:34 +02:00
parent 9d8e3d4185
commit f9e1913e0d

View File

@@ -96,15 +96,21 @@ Mono<Account> account = client.get()
.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]
====
The `AsyncRestTemplate` also supports non-blocking interactions. The main difference
is it can't support non-blocking streaming, like for example
https://dev.twitter.com/streaming/overview[Twitter one], because fundamentally it's
still based and relies on `InputStream` and `OutputStream`.
====
[source,java,indent=0]
[subs="verbatim,quotes"]
----
SslContext sslContext = ...
ReactorClientHttpConnector connector = new ReactorClientHttpConnector(builder -> {
builder.sslContext(sslContext);
});
WebClient webClient = WebClient.builder()
.clientConnector(connector)
.build();
----
[[webflux-http-body]]
== Request and Response Body Conversion