You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/io/rest-client.adoc
+22-2Lines changed: 22 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,19 @@ For example, to add BASIC authentication support, you can use `builder.basicAuth
18
18
19
19
20
20
21
+
[[io.rest-client.resttemplate.http-client]]
22
+
==== RestTemplate HTTP Client
23
+
Spring Boot will auto-detect which HTTP client to use with `RestTemplate` depending on the libraries available on the application classpath.
24
+
In order of preference, the following clients are supported:
25
+
26
+
. Apache HttpClient
27
+
. OkHttp
28
+
. Simple JDK client (`HttpURLConnection`)
29
+
30
+
If multiple clients are available on the classpath, the most preferred client will be used.
31
+
32
+
33
+
21
34
[[io.rest-client.resttemplate.customization]]
22
35
==== RestTemplate Customization
23
36
There are three main approaches to `RestTemplate` customization, depending on how broadly you want the customizations to apply.
@@ -70,8 +83,15 @@ include::code:MyService[]
70
83
71
84
[[io.rest-client.webclient.runtime]]
72
85
==== WebClient Runtime
73
-
Spring Boot will auto-detect which `ClientHttpConnector` to use to drive `WebClient`, depending on the libraries available on the application classpath.
74
-
For now, Reactor Netty, Jetty ReactiveStream client, Apache HttpClient, and the JDK's HttpClient are supported.
86
+
Spring Boot will auto-detect which `ClientHttpConnector` to use to drive `WebClient` depending on the libraries available on the application classpath.
87
+
In order of preference, the following clients are supported:
88
+
89
+
. Reactor Netty
90
+
. Jetty RS client
91
+
. Apache HttpClient
92
+
. JDK HttpClient
93
+
94
+
If multiple clients are available on the classpath, the most preferred client will be used.
75
95
76
96
The `spring-boot-starter-webflux` starter depends on `io.projectreactor.netty:reactor-netty` by default, which brings both server and client implementations.
77
97
If you choose to use Jetty as a reactive server instead, you should add a dependency on the Jetty Reactive HTTP client library, `org.eclipse.jetty:jetty-reactive-httpclient`.
0 commit comments