@@ -31,6 +31,7 @@ import org.springframework.http.client.reactive.ClientHttpRequest;
31
31
import org.springframework.web.client.RestClientException;
32
32
import org.springframework.web.util.UriComponentsBuilder;
33
33
import org.springframework.web.reactive.function.client.WebClient;
34
+ import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
34
35
import org.springframework.web.reactive.function.client.ClientResponse;
35
36
import org.springframework.web.reactive.function.BodyInserter;
36
37
import org.springframework.web.reactive.function.BodyInserters;
@@ -604,31 +605,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
604
605
* @param returnType The return type into which to deserialize the response
605
606
* @return The response body in chosen type
606
607
*/
607
- public <T > Mono< T > invokeAPI(String path, HttpMethod method, Map<String , Object > pathParams, MultiValueMap<String , String > queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String , String > cookieParams, MultiValueMap<String , Object > formParams, List<MediaType > accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T > returnType) throws RestClientException {
608
+ public <T > ResponseSpec invokeAPI(String path, HttpMethod method, Map<String , Object > pathParams, MultiValueMap<String , String > queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String , String > cookieParams, MultiValueMap<String , Object > formParams, List<MediaType > accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T > returnType) throws RestClientException {
608
609
final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames);
609
- return requestBuilder.retrieve().bodyToMono(returnType);
610
- }
611
-
612
- /**
613
- * Invoke API by sending HTTP request with the given options.
614
- *
615
- * @param <T > the return type to use
616
- * @param path The sub-path of the HTTP URL
617
- * @param method The request method
618
- * @param pathParams The path parameters
619
- * @param queryParams The query parameters
620
- * @param body The request body object
621
- * @param headerParams The header parameters
622
- * @param formParams The form parameters
623
- * @param accept The request's Accept header
624
- * @param contentType The request's Content-Type header
625
- * @param authNames The authentications to apply
626
- * @param returnType The return type into which to deserialize the response
627
- * @return The response body in chosen type
628
- */
629
- public <T > Flux<T > invokeFluxAPI(String path, HttpMethod method, Map<String , Object > pathParams, MultiValueMap<String , String > queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String , String > cookieParams, MultiValueMap<String , Object > formParams, List<MediaType > accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T > returnType) throws RestClientException {
630
- final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames);
631
- return requestBuilder.retrieve().bodyToFlux(returnType);
610
+ return requestBuilder.retrieve();
632
611
}
633
612
634
613
private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map<String , Object > pathParams, MultiValueMap<String , String > queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String , String > cookieParams, MultiValueMap<String , Object > formParams, List<MediaType > accept, MediaType contentType, String[] authNames) {
0 commit comments