2017-09-28 11:34:45 +08:00
|
|
|
[[webflux-client]]
|
|
|
|
= WebClient
|
2023-04-19 23:26:17 +08:00
|
|
|
:page-section-summary-toc: 1
|
2017-09-28 11:34:45 +08:00
|
|
|
|
2020-09-26 04:14:57 +08:00
|
|
|
Spring WebFlux includes a client to perform HTTP requests with. `WebClient` has a
|
2023-04-19 23:26:17 +08:00
|
|
|
functional, fluent API based on Reactor, see xref:web-reactive.adoc#webflux-reactive-libraries[Reactive Libraries],
|
2020-09-26 04:14:57 +08:00
|
|
|
which enables declarative composition of asynchronous logic without the need to deal with
|
|
|
|
threads or concurrency. It is fully non-blocking, it supports streaming, and relies on
|
2023-04-19 23:26:17 +08:00
|
|
|
the same xref:web/webflux/reactive-spring.adoc#webflux-codecs[codecs] that are also used to encode and
|
2020-09-26 04:14:57 +08:00
|
|
|
decode request and response content on the server side.
|
2018-02-15 06:32:24 +08:00
|
|
|
|
2020-09-26 04:14:57 +08:00
|
|
|
`WebClient` needs an HTTP client library to perform requests with. There is built-in
|
|
|
|
support for the following:
|
|
|
|
|
2023-11-21 22:59:24 +08:00
|
|
|
* {reactor-github-org}/reactor-netty[Reactor Netty]
|
|
|
|
* {java-api}/java.net.http/java/net/http/HttpClient.html[JDK HttpClient]
|
2020-09-26 04:14:57 +08:00
|
|
|
* https://github.com/jetty-project/jetty-reactive-httpclient[Jetty Reactive HttpClient]
|
|
|
|
* https://hc.apache.org/index.html[Apache HttpComponents]
|
|
|
|
* Others can be plugged via `ClientHttpConnector`.
|
2017-09-28 11:34:45 +08:00
|
|
|
|
|
|
|
|
2018-02-15 06:32:24 +08:00
|
|
|
|
2018-10-25 21:15:58 +08:00
|
|
|
|