Skip to content

Add status code check to bodyTo[Mono|Flux] [SPR-14977] #19543

@spring-projects-issues

Description

@spring-projects-issues

Arjen Poutsma opened SPR-14977 and commented

The retrieveMono and retrieveFlux methods on WebClient allow users to retrieve the body of the response, with an exception if the response status code is 4xx or 5xx. However, these methods are the exception, rather than the rule: bodytoMono and bodyToFlux on ClientResponse do not check the status code.

Checking for status codes should be the default: bodyToMono and bodyToFlux should do so. If that change is made, we can get rid of retrieveMono and retrieveFlux on WebClient, since they offer no added value any more. Retrieving the body without a status code check will be exposed in the standard body method.


No further details from SPR-14977

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions