This section describes options for client-side access to REST endpoints.
RestTemplate is a synchronous client to perform HTTP requests. It is the original
Spring REST client, exposing a simple, template method API over underlying HTTP client
libraries.
|
Note
|
As of 5.0, the non-blocking, reactive |
See RestTemplate for details.
WebClient is a non-blocking, reactive client to perform HTTP requests. It was
introduced in 5.0 and offers a modern alternative to the RestTemplate with efficient
support for both synchronous and asynchronous, as well as streaming scenarios.
In contrast to the RestTemplate, the WebClient supports the following:
-
Non-blocking I/O.
-
Reactive Streams back pressure.
-
High concurrency with less hardware resources.
-
Functional-style, fluent API taking advantage of Java 8 lambdas.
-
Synchronous and asynchronous interactions.
-
Streaming up to or streaming down from a server.
See WebClient for more details.