|
33 | 33 | */
|
34 | 34 | public interface HttpClientAdapter {
|
35 | 35 |
|
| 36 | + /** |
| 37 | + * Perform the given request, and release the response content, if any. |
| 38 | + * @param requestValues the request to perform |
| 39 | + * @return {@code Mono} that completes when the request is fully executed |
| 40 | + * and the response content is released. |
| 41 | + */ |
36 | 42 | Mono<Void> requestToVoid(HttpRequestValues requestValues);
|
37 | 43 |
|
| 44 | + /** |
| 45 | + * Perform the given request, release the response content, and return the |
| 46 | + * response headers. |
| 47 | + * @param requestValues the request to perform |
| 48 | + * @return {@code Mono} that returns the response headers the request is |
| 49 | + * fully executed and the response content released. |
| 50 | + */ |
38 | 51 | Mono<HttpHeaders> requestToHeaders(HttpRequestValues requestValues);
|
39 | 52 |
|
| 53 | + /** |
| 54 | + * Perform the given request and decode the response content to the given type. |
| 55 | + * @param requestValues the request to perform |
| 56 | + * @param bodyType the target type to decode to |
| 57 | + * @return {@code Mono} that returns the decoded response. |
| 58 | + * @param <T> the type the response is decoded to |
| 59 | + */ |
40 | 60 | <T> Mono<T> requestToBody(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType);
|
41 | 61 |
|
| 62 | + /** |
| 63 | + * Perform the given request and decode the response content to a stream with |
| 64 | + * elements of the given type. |
| 65 | + * @param requestValues the request to perform |
| 66 | + * @param bodyType the target stream element type to decode to |
| 67 | + * @return {@code Flux} with decoded stream elements. |
| 68 | + * @param <T> the type the response is decoded to |
| 69 | + */ |
42 | 70 | <T> Flux<T> requestToBodyFlux(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType);
|
43 | 71 |
|
| 72 | + /** |
| 73 | + * Variant of {@link #requestToVoid(HttpRequestValues)} with additional |
| 74 | + * access to the response status and headers. |
| 75 | + */ |
44 | 76 | Mono<ResponseEntity<Void>> requestToBodilessEntity(HttpRequestValues requestValues);
|
45 | 77 |
|
| 78 | + /** |
| 79 | + * Variant of {@link #requestToBody(HttpRequestValues, ParameterizedTypeReference)} |
| 80 | + * with additional access to the response status and headers. |
| 81 | + */ |
46 | 82 | <T> Mono<ResponseEntity<T>> requestToEntity(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType);
|
47 | 83 |
|
| 84 | + /** |
| 85 | + * Variant of {@link #requestToBodyFlux(HttpRequestValues, ParameterizedTypeReference)} |
| 86 | + * with additional access to the response status and headers. |
| 87 | + */ |
48 | 88 | <T> Mono<ResponseEntity<Flux<T>>> requestToEntityFlux(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType);
|
49 | 89 |
|
50 | 90 | }
|
0 commit comments