From 1efa162cf04a7df2a95974e9102452915ae3b345 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Fri, 31 Mar 2023 11:19:40 +0200 Subject: [PATCH] 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 --- .../springframework/web/reactive/function/client/WebClient.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java index 62a34144cf3..f7cbb9f4265 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java @@ -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. + *

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