New in Spring 6.1: RestClient
Spring Framework 6.1 M2 introduces the RestClient
, a new synchronous HTTP client.
As the name suggests, RestClient
offers the fluent API of WebClient
with the infrastructure of RestTemplate
.
Fourteen years ago, when RestTemplate
was introduced in Spring Framework 3.0, we quickly discovered that exposing every capability of HTTP in a template-like class resulted in too many overloaded methods.
In Spring Framework 5, we therefore used a fluent API for the reactive WebClient
.
With RestClient
we are introducing a HTTP client that offers an API similar to WebClient
, and that uses the message converters, request factories, interceptors, and other underlying components of RestTemplate
…