user2457545
user2457545

Reputation: 11

Spring WebFlux WebClient - 400 Bad Request for Webclient POST call

I am trying to use spring Reactive Webclient to post payload remote microservice. When I post it via postman I am getting response back with { Status: “Success”, statusId:”dff-1244”}. But from via IJ IDE when I debug it is logging 400 BAD Request exception.Sample as follows below

'''

import org.springframework.web.reactive.function.client.WebClient;
    
    webClient.post()
                    .uri("url")
                    .contentType(MediaType.APPLICATION_JSON)
                    .bodyValue(payload)
                    .retrieve()
                    .bodyToMono(String.class).block();

'''

Upvotes: 0

Views: 18

Answers (0)

Related Questions