Spring Webflux : How to return HTTP 200 response with body when the called service returns HTTP 201 without body with WebClient?

I have a micro service(Java+Spring Boot) which receives HTTP request, and then I invoke a REST API call over HTTP to another service. The called service returns HTTP status 201(no response body), but I need to return HTTP 200 with response body.

I am using WebClient to call the other service and for 201 status I am using bodyToMono(Void.class) So how do I return HTTP 200 response body for the clients of my microservice? Whats the best practice? Also how to write a Component Test for the service which is invoking the external service which returns HTTP 201?

Thanks



from Recent Questions - Stack Overflow https://ift.tt/2WMuAVd
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Object oriented programming concepts (OOPs)