Spring WebFlux WebClient - 400 Bad Request for Webclient POST call - Stack Overflow

admin2025-04-18  5

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();

'''

转载请注明原文地址:http://www.anycun.com/QandA/1744939220a89763.html