added LinkedMultiValueMap usage for inserter declaration, as in article

This commit is contained in:
Gerardo Roza 2021-01-21 14:57:06 -03:00
parent 1f7e0f06b6
commit e6ab521b61
1 changed files with 3 additions and 1 deletions

View File

@ -13,8 +13,10 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ReactiveHttpOutputMessage; import org.springframework.http.ReactiveHttpOutputMessage;
import org.springframework.http.client.reactive.ClientHttpRequest;
import org.springframework.http.client.reactive.ReactorClientHttpConnector; import org.springframework.http.client.reactive.ReactorClientHttpConnector;
import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -58,7 +60,7 @@ public class WebClientController {
map.add("key1", "value1"); map.add("key1", "value1");
map.add("key2", "value2"); map.add("key2", "value2");
// BodyInserter<MultiValueMap<String, ?>, ClientHttpRequest> inserter2 = BodyInserters.fromMultipartData(map); BodyInserter<MultiValueMap<String, Object>, ClientHttpRequest> inserter2 = BodyInserters.fromMultipartData(map);
BodyInserter<String, ReactiveHttpOutputMessage> inserter3 = BodyInserters.fromValue("body"); BodyInserter<String, ReactiveHttpOutputMessage> inserter3 = BodyInserters.fromValue("body");
// responses // responses