Browse Source

Added docs on customizing WebClient

Issue: SPR-15778
pull/1534/head
Arjen Poutsma 9 years ago
parent
commit
f9e1913e0d
  1. 22
      src/docs/asciidoc/web/webflux.adoc

22
src/docs/asciidoc/web/webflux.adoc

@ -96,15 +96,21 @@ Mono<Account> account = client.get() @@ -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

Loading…
Cancel
Save