Shekhar Rathore
Shekhar Rathore

Reputation: 65

Trying to Send list of string in post request using webClient in spring

Upvotes: 2

Views: 6879

Answers (1)

K.Nicholas
K.Nicholas

Reputation: 11551

You cannot send a Flux of strings because it combines them into a single string. See,

WebClient bodyToFlux(String.class) for string list doesn't separate individual value

You are creating a Flux of strings at Flux.fromIterable(str). What you need to do is put the string into a wrapper class or send a Mono of a list. See, e.g., Reactive Programming: Spring WebFlux: How to build a chain of micro-service calls?

Upvotes: 1

Related Questions