Skip to content

Commit 1efa162

Browse files
committed
WebClient defaultStatusHandler do not apply to exchangeTo*
This commit documents the fact that default status handlers configured on the `WebClient` are not applied to `exchangeTo*` methods as those variants give full access to the client response. Applying them here would restrict the ability to adapt the behavior depending on the HTTP response status. Closes gh-30059
1 parent a8b7a5e commit 1efa162

File tree

1 file changed

+2
-0
lines changed
  • spring-webflux/src/main/java/org/springframework/web/reactive/function/client

1 file changed

+2
-0
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ interface Builder {
263263
* apply to every response. Such default handlers are applied in the
264264
* order in which they are registered, and after any others that are
265265
* registered for a specific response.
266+
* <p>The default status handlers are not applied to {@code exchangeTo*()}
267+
* methods, as those variants have direct access to the client response.
266268
* @param statusPredicate to match responses with
267269
* @param exceptionFunction to map the response to an error signal
268270
* @return this builder

0 commit comments

Comments
 (0)