Skip to content

Commit 8691173

Browse files
committed
Create RestClient documentation placeholder
This commit creates a placeholder for future RestClient reference documentation. It also creats a link to RestClient from the RestTemplate javadoc. See gh-30826
1 parent ddc3cf3 commit 8691173

File tree

3 files changed

+27
-29
lines changed

3 files changed

+27
-29
lines changed

framework-docs/modules/ROOT/pages/integration/rest-clients.adoc

+10-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@
33

44
The Spring Framework provides the following choices for making calls to REST endpoints:
55

6+
* xref:integration/rest-clients.adoc#rest-restclient[`RestClient`] - synchronous client with a fluent API.
67
* xref:integration/rest-clients.adoc#rest-webclient[`WebClient`] - non-blocking, reactive client with fluent API.
78
* xref:integration/rest-clients.adoc#rest-resttemplate[`RestTemplate`] - synchronous client with template method API.
89
* xref:integration/rest-clients.adoc#rest-http-interface[HTTP Interface] - annotated interface with generated, dynamic proxy implementation.
910

1011

12+
[[rest-restclient]]
13+
== `RestClient`
14+
15+
Reference documentation is forthcoming.
16+
For now, please refer to the https://docs.spring.io/spring-framework/docs/6.1.0-M1/javadoc-api/org/springframework/web/client/RestClient.html[API documentation].
17+
18+
1119
[[rest-webclient]]
1220
== `WebClient`
1321

@@ -36,9 +44,8 @@ The `RestTemplate` provides a higher level API over HTTP client libraries. It ma
3644
easy to invoke REST endpoints in a single line. It exposes the following groups of
3745
overloaded methods:
3846

39-
NOTE: `RestTemplate` is in maintenance mode, with only requests for minor
40-
changes and bugs to be accepted. Please, consider using the
41-
xref:web/webflux-webclient.adoc[WebClient] instead.
47+
NOTE: The xref:integration/rest-clients.adoc#rest-restclient[`RestClient`] offers a more modern API for synchronous HTTP access.
48+
For asynchronous and streaming scenarios, consider the reactive xref:web/webflux-webclient.adoc[WebClient].
4249

4350
[[rest-overview-of-resttemplate-methods-tbl]]
4451
.RestTemplate methods

framework-docs/modules/ROOT/pages/web/webmvc-client.adoc

+13-22
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,34 @@ This section describes options for client-side access to REST endpoints.
66

77

88

9-
[[webmvc-resttemplate]]
10-
== `RestTemplate`
11-
12-
`RestTemplate` is a synchronous client to perform HTTP requests. It is the original
13-
Spring REST client and exposes a simple, template-method API over underlying HTTP client
14-
libraries.
9+
[[webmvc-restclient]]
10+
== `RestClient`
1511

16-
NOTE: As of 5.0 the `RestTemplate` is in maintenance mode, with only requests for minor
17-
changes and bugs to be accepted. Please, consider using the
18-
xref:web/webflux-webclient.adoc[WebClient] which offers a more modern API and
19-
supports sync, async, and streaming scenarios.
12+
`RestClient` is a synchronous HTTP client that exposes a modern, fluent API.
2013

21-
See xref:integration/rest-clients.adoc[REST Endpoints] for details.
14+
See xref:integration/rest-clients.adoc#rest-restclient[`RestClient`] for more details.
2215

2316

2417

2518

2619
[[webmvc-webclient]]
2720
== `WebClient`
2821

29-
`WebClient` is a non-blocking, reactive client to perform HTTP requests. It was
30-
introduced in 5.0 and offers a modern alternative to the `RestTemplate`, with efficient
31-
support for both synchronous and asynchronous, as well as streaming scenarios.
22+
`WebClient` is a reactive client to perform HTTP requests with a fluent API.
23+
24+
See xref:web/webflux-webclient.adoc[WebClient] for more details.
3225

33-
In contrast to `RestTemplate`, `WebClient` supports the following:
3426

35-
* Non-blocking I/O.
36-
* Reactive Streams back pressure.
37-
* High concurrency with fewer hardware resources.
38-
* Functional-style, fluent API that takes advantage of Java 8 lambdas.
39-
* Synchronous and asynchronous interactions.
40-
* Streaming up to or streaming down from a server.
4127

42-
See xref:web/webflux-webclient.adoc[WebClient] for more details.
4328

29+
[[webmvc-resttemplate]]
30+
== `RestTemplate`
4431

32+
`RestTemplate` is a synchronous client to perform HTTP requests. It is the original
33+
Spring REST client and exposes a simple, template-method API over underlying HTTP client
34+
libraries.
4535

36+
See xref:integration/rest-clients.adoc[REST Endpoints] for details.
4637

4738
[[webmvc-http-interface]]
4839
== HTTP Interface

spring-web/src/main/java/org/springframework/web/client/RestTemplate.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@
8989
* instances may use the same underlying {@link ClientHttpRequestFactory}
9090
* if they need to share HTTP client resources.
9191
*
92-
* <p><strong>NOTE:</strong> As of 5.0 this class is in maintenance mode, with
93-
* only minor requests for changes and bugs to be accepted going forward. Please,
94-
* consider using the {@code org.springframework.web.reactive.client.WebClient}
95-
* which has a more modern API and supports sync, async, and streaming scenarios.
92+
* <p><strong>NOTE:</strong> As of 6.1, {@link RestClient} offers a more modern
93+
* API for synchronous HTTP access. For asynchronous and streaming scenarios,
94+
* consider the reactive
95+
* {@link org.springframework.web.reactive.function.client.WebClient}.
9696
*
9797
* @author Arjen Poutsma
9898
* @author Brian Clozel

0 commit comments

Comments
 (0)