Spring Framework: 6.0.11
The Javadoc of org.springframework.web.reactive.function.client.WebClientResponseException#getResponseBodyAs(java.lang.Class<E>)
states:
https://github.com/spring-projects/spring-framework/blob/84045374744aee245d1ed717454cb91e5d1c1ad3/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClientResponseException.java#L229
However, when the response body is empty, the following exception is thrown: org.springframework.core.codec.DecodingException: JSON decoding error: No content to map due to end-of-input
Reproducer (extract and run the test): demo.zip
I was expecting null
, but I'm getting an exception instead.