Top Description Fields Constructors Methods
reactor.netty5.http.client

pack-priv final Class HttpClientFinalizer

extends HttpClientConnect
implements RequestSender
Class Inheritance
All Implemented Interfaces
reactor.netty5.http.client.HttpClient.RequestSender, reactor.netty5.http.client.HttpClient.ResponseReceiver, reactor.netty5.http.client.HttpClient.UriConfiguration
Imports
java.net.URI, java.util.Objects, java.util.function.BiConsumer, .BiFunction, .Consumer, .Function, io.netty5.buffer.Buffer, .BufferAllocator, io.netty5.channel.ChannelOption, org.reactivestreams.Publisher, reactor.core.publisher.Flux, .Mono, reactor.netty5.BufferFlux, .BufferMono, .Connection, .NettyOutbound, reactor.netty5.channel.ChannelOperations, reactor.util.annotation.Nullable

Configures the HTTP request before calling one of the terminal, Publisher based, ResponseReceiver API.
Authors
Stephane Maldini, Violeta Georgieva

Field Summary

Modifier and TypeField and Description
pack-priv static final Function<ChannelOperations<?, ?>, Publisher<Buffer>>
pack-priv static final Function<HttpClientOperations, HttpClientResponse>
Inherited from reactor.netty5.http.client.HttpClientConnect:
ALLconfigDEFAULT_PORTlogURI_ADDRESS_MAPPER

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv Mono<HttpClientOperations>
pack-priv static void
protected HttpClient
duplicate()

Overrides reactor.netty5.http.client.HttpClientConnect.duplicate.

Return a new Transport inheriting the current configuration.
public Mono<HttpClientResponse>
response()

Implements reactor.netty5.http.client.HttpClient.ResponseReceiver.response.

Return the response status and headers as HttpClientResponse

Will automatically close the response if necessary.

public <V> Flux<V>
response(BiFunction<? super HttpClientResponse, ? super BufferFlux, ? extends Publisher<V>>
extracting receiver
receiver
)

Implements reactor.netty5.http.client.HttpClient.ResponseReceiver.response.

Extract a response flux from the given HttpClientResponse and body BufferFlux.
public <V> Flux<V>
responseConnection(BiFunction<? super HttpClientResponse, ? super Connection, ? extends Publisher<V>>
extracting receiver
receiver
)

Implements reactor.netty5.http.client.HttpClient.ResponseReceiver.responseConnection.

Extract a response flux from the given HttpClientResponse and underlying Connection.
public BufferFlux
public <V> Mono<V>
responseSingle(BiFunction<? super HttpClientResponse, ? super BufferMono, ? extends Mono<V>>
extracting receiver
receiver
)

Implements reactor.netty5.http.client.HttpClient.ResponseReceiver.responseSingle.

Extract a response mono from the given HttpClientResponse and aggregated body BufferMono.
public HttpClientFinalizer
send(BiFunction<? super HttpClientRequest, ? super NettyOutbound, ? extends Publisher<Void>>
a bifunction given the outgoing request and the sending NettyOutbound, returns a publisher that will terminate the request body on complete
sender
)

Implements reactor.netty5.http.client.HttpClient.RequestSender.send.

Configure a body to send on request using the NettyOutbound sending builder and returning a Publisher to signal end of the request.
public HttpClientFinalizer
send(Publisher<? extends Buffer>
a body publisher that will terminate the request on complete
requestBody
)

Implements reactor.netty5.http.client.HttpClient.RequestSender.send.

Configure a body to send on request.
public HttpClientFinalizer
sendForm(BiConsumer<? super HttpClientRequest, HttpClientForm>
called when form generator is created
formCallback
,
Consumer<Flux<Long>>
called after form is being sent and passed with a Flux of the latest in-flight or uploaded bytes
progress
)

Implements reactor.netty5.http.client.HttpClient.RequestSender.sendForm.

Prepare to send an HTTP Form including Multipart encoded Form which support chunked file upload.
public HttpClient.RequestSender
uri(Mono<String>
target URI, if starting with "/" it will be prepended with baseUrl(String) when available
uri
)

Implements reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Configure URI to use for this request/response on subscribe
public HttpClient.RequestSender
uri(String
target URI, if starting with "/" it will be prepended with baseUrl(String) when available
uri
)

Implements reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Configure URI to use for this request/response
public HttpClient.RequestSender
uri(URI
target URI which is an absolute, fully constructed URI
uri
)

Implements reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Configure URI to use for this request/response.
Inherited from reactor.netty5.http.client.HttpClientConnect:
configurationconnecttoString

Field Detail

contentReceiverback to summary
pack-priv static final Function<ChannelOperations<?, ?>, Publisher<Buffer>> contentReceiver
RESPONSE_ONLYback to summary
pack-priv static final Function<HttpClientOperations, HttpClientResponse> RESPONSE_ONLY

Constructor Detail

HttpClientFinalizerback to summary
pack-priv HttpClientFinalizer(HttpClientConfig config)

Method Detail

_connectback to summary
pack-priv Mono<HttpClientOperations> _connect()
Annotations
@SuppressWarnings:unchecked
discardback to summary
pack-priv static void discard(HttpClientOperations c)
duplicateback to summary
protected HttpClient duplicate()

Overrides reactor.netty5.http.client.HttpClientConnect.duplicate.

Doc from reactor.netty5.transport.Transport.duplicate.

Return a new Transport inheriting the current configuration. This is a shallow copy.

Returns:HttpClient

a new Transport inheriting the current configuration

Annotations
@Override
responseback to summary
public Mono<HttpClientResponse> response()

Implements reactor.netty5.http.client.HttpClient.ResponseReceiver.response.

Doc from reactor.netty5.http.client.HttpClient.ResponseReceiver.response.

Return the response status and headers as HttpClientResponse

Will automatically close the response if necessary.

Note

Will automatically close low-level network connection after returned Mono terminates or is being cancelled.

Returns:Mono<HttpClientResponse>

the response status and headers as HttpClientResponse

Annotations
@Override
responseback to summary
public <V> Flux<V> response(BiFunction<? super HttpClientResponse, ? super BufferFlux, ? extends Publisher<V>> receiver)

Implements reactor.netty5.http.client.HttpClient.ResponseReceiver.response.

Doc from reactor.netty5.http.client.HttpClient.ResponseReceiver.response.

Extract a response flux from the given HttpClientResponse and body BufferFlux.

Will automatically close the response if necessary after the returned Flux terminates or is being cancelled.

Parameters
<V>
the extracted flux type
receiver:BiFunction<? super HttpClientResponse, ? super BufferFlux, ? extends Publisher<V>>

extracting receiver

Returns:Flux<V>

a Flux forwarding the returned Publisher sequence

Annotations
@Override
responseConnectionback to summary
public <V> Flux<V> responseConnection(BiFunction<? super HttpClientResponse, ? super Connection, ? extends Publisher<V>> receiver)

Implements reactor.netty5.http.client.HttpClient.ResponseReceiver.responseConnection.

Doc from reactor.netty5.http.client.HttpClient.ResponseReceiver.responseConnection.

Extract a response flux from the given HttpClientResponse and underlying Connection.

The connection will not automatically Connection#dispose() and manual interaction with this method might be necessary if the remote never terminates itself.

Parameters
<V>
the extracted flux type
receiver:BiFunction<? super HttpClientResponse, ? super Connection, ? extends Publisher<V>>

extracting receiver

Returns:Flux<V>

a Flux forwarding the returned Publisher sequence

Annotations
@Override
responseContentback to summary
public BufferFlux responseContent()

Implements reactor.netty5.http.client.HttpClient.ResponseReceiver.responseContent.

Doc from reactor.netty5.http.client.HttpClient.ResponseReceiver.responseContent.

Return the response body chunks as BufferFlux.

Will automatically close the response if necessary after the returned Flux terminates or is being cancelled.

Returns:BufferFlux

the response body chunks as BufferFlux.

Annotations
@Override
responseSingleback to summary
public <V> Mono<V> responseSingle(BiFunction<? super HttpClientResponse, ? super BufferMono, ? extends Mono<V>> receiver)

Implements reactor.netty5.http.client.HttpClient.ResponseReceiver.responseSingle.

Doc from reactor.netty5.http.client.HttpClient.ResponseReceiver.responseSingle.

Extract a response mono from the given HttpClientResponse and aggregated body BufferMono.

Will automatically close the response if necessary after the returned Mono terminates or is being cancelled.

Parameters
<V>
the extracted mono type
receiver:BiFunction<? super HttpClientResponse, ? super BufferMono, ? extends Mono<V>>

extracting receiver

Returns:Mono<V>

a Mono forwarding the returned Mono result

Annotations
@Override
sendback to summary
public HttpClientFinalizer send(BiFunction<? super HttpClientRequest, ? super NettyOutbound, ? extends Publisher<Void>> sender)

Implements reactor.netty5.http.client.HttpClient.RequestSender.send.

Doc from reactor.netty5.http.client.HttpClient.RequestSender.send.

Configure a body to send on request using the NettyOutbound sending builder and returning a Publisher to signal end of the request.

Note

The sender BiFunction passed in will be invoked also for redirect requests when followRedirect is enabled. For redirect requests, sensitive headers followRedirect are removed from the initialized request when redirecting to a different domain, they can be re-added globally via followRedirect(boolean, Consumer)/followRedirect(BiPredicate, Consumer) or alternatively for full control per redirect request, consider using RedirectSendHandler. RedirectSendHandler can be used to indicate explicitly that this BiFunction has special handling for redirect requests.

Parameters
sender:BiFunction<? super HttpClientRequest, ? super NettyOutbound, ? extends Publisher<Void>>

a bifunction given the outgoing request and the sending NettyOutbound, returns a publisher that will terminate the request body on complete

Returns:HttpClientFinalizer

a new ResponseReceiver

Annotations
@Override
sendback to summary
public HttpClientFinalizer send(Publisher<? extends Buffer> requestBody)

Implements reactor.netty5.http.client.HttpClient.RequestSender.send.

Doc from reactor.netty5.http.client.HttpClient.RequestSender.send.

Configure a body to send on request.

Note

The body Publisher passed in will be invoked also for redirect requests when followRedirect is enabled. If you need to control what will be sent when followRedirect is enabled then use send(BiFunction).

Note

For redirect requests, sensitive headers followRedirect are removed from the initialized request when redirecting to a different domain, they can be re-added globally via followRedirect(boolean, Consumer)/followRedirect(BiPredicate, Consumer) or alternatively for full control per redirect request, consider using RedirectSendHandler with send(BiFunction)

Parameters
requestBody:Publisher<? extends Buffer>

a body publisher that will terminate the request on complete

Returns:HttpClientFinalizer

a new ResponseReceiver

Annotations
@Override
sendFormback to summary
public HttpClientFinalizer sendForm(BiConsumer<? super HttpClientRequest, HttpClientForm> formCallback, Consumer<Flux<Long>> progress)

Implements reactor.netty5.http.client.HttpClient.RequestSender.sendForm.

Doc from reactor.netty5.http.client.HttpClient.RequestSender.sendForm.

Prepare to send an HTTP Form including Multipart encoded Form which support chunked file upload. It will by default be encoded as Multipart but can be adapted via HttpClientForm#multipart(boolean).

Note

The HTTP Form passed in will be invoked also for redirect requests when followRedirect is enabled. If you need to control what will be sent when followRedirect is enabled use HttpClientRequest#redirectedFrom() to check the original and any number of subsequent redirect(s), including the one that is in progress.

Note

For redirect requests, sensitive headers followRedirect are removed from the initialized request when redirecting to a different domain, they can be re-added globally via followRedirect(boolean, Consumer)/followRedirect(BiPredicate, Consumer).

Parameters
formCallback:BiConsumer<? super HttpClientRequest, HttpClientForm>

called when form generator is created

progress:Consumer<Flux<Long>>

called after form is being sent and passed with a Flux of the latest in-flight or uploaded bytes

Returns:HttpClientFinalizer

a new ResponseReceiver

Annotations
@Override
uriback to summary
public HttpClient.RequestSender uri(Mono<String> uri)

Implements reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Doc from reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Configure URI to use for this request/response on subscribe

Parameters
uri:Mono<String>

target URI, if starting with "/" it will be prepended with baseUrl(String) when available

Returns:HttpClient.RequestSender

the appropriate sending or receiving contract

Annotations
@Override
uriback to summary
public HttpClient.RequestSender uri(String uri)

Implements reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Doc from reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Configure URI to use for this request/response

Parameters
uri:String

target URI, if starting with "/" it will be prepended with baseUrl(String) when available

Returns:HttpClient.RequestSender

the appropriate sending or receiving contract

Annotations
@Override
uriback to summary
public HttpClient.RequestSender uri(URI uri)

Implements reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Doc from reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Configure URI to use for this request/response.

Note

baseUrl(String) will have no effect when this method is used for configuring an URI.

Parameters
uri:URI

target URI which is an absolute, fully constructed URI

Returns:HttpClient.RequestSender

the appropriate sending or receiving contract

Annotations
@Override