bodyToFlux() extracts a WebClient response body as a Flux of a specified type. Use it when one request returns multiple items, such as a collection of ingredients. section 12.4.1
Flux<Ingredient> ingredients = WebClient.create()
.get()
.uri("http://localhost:8080/ingredients")
.retrieve()
.bodyToFlux(Ingredient.class);
ingredients.subscribe(i -> { ... });
This request retrieves all ingredients and converts the response into a Flux<Ingredient>. The Flux remains lazy: apply operations such as filtering or mapping, then subscribe so the request is sent and data begins flowing. section 12.4.1
The operation commonly follows get(), uri(), and retrieve(). Unlike bodyToMono(), which produces one value, bodyToFlux() produces a stream of values. For advanced response handling, exchangeToFlux() exposes ClientResponse objects instead, including response metadata such as headers and cookies. section 12.4.1 section 12.4.5
