Package reactor.netty.http.client
Interface HttpClient.ResponseReceiver<S extends HttpClient.ResponseReceiver<?>>
- All Superinterfaces:
HttpClient.UriConfiguration<S>
- All Known Subinterfaces:
HttpClient.RequestSender
- Enclosing class:
- HttpClient
public static interface HttpClient.ResponseReceiver<S extends HttpClient.ResponseReceiver<?>>
extends HttpClient.UriConfiguration<S>
A response extractor for this configured
HttpClient
. Since
HttpClient.ResponseReceiver
API returns Flux
or Mono
,
requesting is always deferred to Publisher.subscribe(Subscriber)
.-
Method Summary
Modifier and TypeMethodDescriptionresponse()
Return the response status and headers asHttpClientResponse
<V> Flux<V>
response
(BiFunction<? super HttpClientResponse, ? super ByteBufFlux, ? extends Publisher<V>> receiver) Extract a response flux from the givenHttpClientResponse
and bodyByteBufFlux
.<V> Flux<V>
responseConnection
(BiFunction<? super HttpClientResponse, ? super Connection, ? extends Publisher<V>> receiver) Extract a response flux from the givenHttpClientResponse
and underlyingConnection
.Return the response body chunks asByteBufFlux
.<V> Mono<V>
responseSingle
(BiFunction<? super HttpClientResponse, ? super ByteBufMono, ? extends Mono<V>> receiver) Extract a response mono from the givenHttpClientResponse
and aggregated bodyByteBufMono
.Methods inherited from interface reactor.netty.http.client.HttpClient.UriConfiguration
uri, uri, uri
-
Method Details
-
response
Mono<HttpClientResponse> response()Return the response status and headers asHttpClientResponse
Will automatically close the response if necessary.
Note: Will automatically close low-level network connection after returned
Mono
terminates or is being cancelled.- Returns:
- the response status and headers as
HttpClientResponse
-
response
<V> Flux<V> response(BiFunction<? super HttpClientResponse, ? super ByteBufFlux, ? extends Publisher<V>> receiver) Extract a response flux from the givenHttpClientResponse
and bodyByteBufFlux
.Will automatically close the response if necessary after the returned
Flux
terminates or is being cancelled. -
responseConnection
<V> Flux<V> responseConnection(BiFunction<? super HttpClientResponse, ? super Connection, ? extends Publisher<V>> receiver) Extract a response flux from the givenHttpClientResponse
and underlyingConnection
.The connection will not automatically
DisposableChannel.dispose()
and manual interaction with this method might be necessary if the remote never terminates itself. -
responseContent
ByteBufFlux responseContent()Return the response body chunks asByteBufFlux
.Will automatically close the response if necessary after the returned
Flux
terminates or is being cancelled.- Returns:
- the response body chunks as
ByteBufFlux
.
-
responseSingle
<V> Mono<V> responseSingle(BiFunction<? super HttpClientResponse, ? super ByteBufMono, ? extends Mono<V>> receiver) Extract a response mono from the givenHttpClientResponse
and aggregated bodyByteBufMono
.Will automatically close the response if necessary after the returned
Mono
terminates or is being cancelled.
-