[서버][스프링] WebClient post로 request pody 전달하는 방법
프로그래밍/서버2021. 4. 18. 22:22
val response = webClient
.mutate()
.build()
.post()
.uri("/v1/items/roomPriceSum")
.bodyValue(roomPriceSumDtoList)
.retrieve()
.bodyToMono(ApiResult::class.java)
WebClient에서 그냥 body()를 사용하면 Flux나 Mono와 같은 wrapper?를 써야한다는 불편함이 있습니다.
body()가 아닌 bodyValue를 쓰면 더 쉬운 것 같네요.
참고
stackoverflow.com/a/61379713/7225691
Spring WebFlux throws 'producer' type is unknow when I return value in the response body
I'm using Spring Boot with Kotlin, and now trying to get status value from a GET restful service by passing a handler for a reactive service. I can see that the handler I'm passing is in the reque...
stackoverflow.com
댓글 영역