Skip to content

Commit 0d40108

Browse files
OlgaMaciaszekrstoyanchev
authored andcommitted
Update docs for HTTP interface clients return values
See gh-30959
1 parent cc92786 commit 0d40108

File tree

1 file changed

+45
-14
lines changed

1 file changed

+45
-14
lines changed

framework-docs/modules/ROOT/pages/integration/rest-clients.adoc

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -495,45 +495,76 @@ method parameters:
495495
[[rest-http-interface-return-values]]
496496
=== Return Values
497497

498-
Annotated, HTTP exchange methods support the following return values:
498+
The supported return values vary depending on whether you are using
499+
`HttpExchangeAdapter` or `ReactorHttpExchangeAdapter`.
500+
501+
When using `HttpExchangeAdapter`, annotated HTTP exchange methods support
502+
the following return values:
499503

500504
[cols="1,2", options="header"]
501505
|===
502506
| Method return value | Description
503507

504-
| `void`, `Mono<Void>`
508+
| `void`
509+
| Perform the given request.
510+
511+
| `HttpHeaders`
512+
| Perform the given request and return the response headers.
513+
514+
| `<T>`
515+
| Perform the given request and decode the response content to the declared return type.
516+
517+
| `ResponseEntity<Void>`
518+
| Perform the given request and return a `ResponseEntity` with the status and headers.
519+
520+
| `ResponseEntity<T>`
521+
| Perform the given request, decode the response content to the declared return type, and
522+
return a `ResponseEntity` with the status, headers, and the decoded body.
523+
524+
|===
525+
526+
When using `ReactorHttpExchangeAdapter`, annotated HTTP exchange methods support
527+
all the same values as the ones supported by `HttpExchangeAdapter`
528+
and also the following ones:
529+
530+
[cols="1,2", options="header"]
531+
|===
532+
| Method return value | Description
533+
534+
| `Mono<Void>`
505535
| Perform the given request, and release the response content, if any.
506536

507-
| `HttpHeaders`, `Mono<HttpHeaders>`
537+
| `Mono<HttpHeaders>`
508538
| Perform the given request, release the response content, if any, and return the
509-
response headers.
539+
response headers.
510540

511-
| `<T>`, `Mono<T>`
541+
| `Mono<T>`
512542
| Perform the given request and decode the response content to the declared return type.
513543

514-
| `<T>`, `Flux<T>`
544+
| `Flux<T>`
515545
| Perform the given request and decode the response content to a stream of the declared
516-
element type.
546+
element type.
517547

518-
| `ResponseEntity<Void>`, `Mono<ResponseEntity<Void>>`
548+
| `Mono<ResponseEntity<Void>>`
519549
| Perform the given request, and release the response content, if any, and return a
520-
`ResponseEntity` with the status and headers.
550+
`ResponseEntity` with the status and headers.
521551

522-
| `ResponseEntity<T>`, `Mono<ResponseEntity<T>>`
552+
| `Mono<ResponseEntity<T>>`
523553
| Perform the given request, decode the response content to the declared return type, and
524-
return a `ResponseEntity` with the status, headers, and the decoded body.
554+
return a `ResponseEntity` with the status, headers, and the decoded body.
525555

526556
| `Mono<ResponseEntity<Flux<T>>`
527557
| Perform the given request, decode the response content to a stream of the declared
528-
element type, and return a `ResponseEntity` with the status, headers, and the decoded
529-
response body stream.
558+
element type, and return a `ResponseEntity` with the status, headers, and the decoded
559+
response body stream.
530560

531561
|===
532562

533563
TIP: You can also use any other async or reactive types registered in the
534564
`ReactiveAdapterRegistry`.
535565

536-
By default, the behavior of HTTP service methods with synchronous (blocking) method
566+
While using the `ReactorHttpExchangeAdapter`, by default, the behavior
567+
of HTTP service methods with synchronous (blocking) method
537568
signature depends on connection and timeout settings of the underlying HTTP client.
538569
`HttpServiceProxyFactory.Builder` does expose a `blockTimeout` option that also lets you
539570
configure the maximum time to block for a response, but we recommend configuring timeout

0 commit comments

Comments
 (0)