Browse Source

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
pull/30264/head
Brian Clozel 3 years ago
parent
commit
1efa162cf0
  1. 2
      spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java

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

@ -263,6 +263,8 @@ public interface WebClient { @@ -263,6 +263,8 @@ public interface WebClient {
* apply to every response. Such default handlers are applied in the
* order in which they are registered, and after any others that are
* registered for a specific response.
* <p>The default status handlers are not applied to {@code exchangeTo*()}
* methods, as those variants have direct access to the client response.
* @param statusPredicate to match responses with
* @param exceptionFunction to map the response to an error signal
* @return this builder

Loading…
Cancel
Save