Interface HttpClient.RequestSender
- All Superinterfaces:
HttpClient.ResponseReceiver<HttpClient.RequestSender>
,HttpClient.UriConfiguration<HttpClient.RequestSender>
- Enclosing class:
- HttpClient
Publisher
based, HttpClient.ResponseReceiver
API.-
Method Summary
Modifier and TypeMethodDescriptionsend
(BiFunction<? super HttpClientRequest, ? super NettyOutbound, ? extends Publisher<Void>> sender) Configure a body to send on request using theNettyOutbound
sending builder and returning aPublisher
to signal end of the request.Configure a body to send on request.default HttpClient.ResponseReceiver<?>
sendForm
(BiConsumer<? super HttpClientRequest, HttpClientForm> formCallback) Prepare to send an HTTP Form including Multipart encoded Form which support chunked file upload.sendForm
(BiConsumer<? super HttpClientRequest, HttpClientForm> formCallback, @Nullable Consumer<Flux<Long>> progress) Prepare to send an HTTP Form including Multipart encoded Form which support chunked file upload.Methods inherited from interface reactor.netty.http.client.HttpClient.ResponseReceiver
response, response, responseConnection, responseContent, responseSingle
Methods inherited from interface reactor.netty.http.client.HttpClient.UriConfiguration
uri, uri, uri
-
Method Details
-
send
Configure a body to send on request.Note: The body
Publisher
passed in will be invoked also for redirect requests whenfollowRedirect
is enabled. If you need to control what will be sent whenfollowRedirect
is enabled then usesend(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 viaHttpClient.followRedirect(boolean, Consumer)
/HttpClient.followRedirect(BiPredicate, Consumer)
or alternatively for full control per redirect request, consider usingHttpClient.RedirectSendHandler
withsend(BiFunction)
- Parameters:
body
- a body publisher that will terminate the request on complete- Returns:
- a new
HttpClient.ResponseReceiver
-
send
HttpClient.ResponseReceiver<?> send(BiFunction<? super HttpClientRequest, ? super NettyOutbound, ? extends Publisher<Void>> sender) Configure a body to send on request using theNettyOutbound
sending builder and returning aPublisher
to signal end of the request.Note: The sender
BiFunction
passed in will be invoked also for redirect requests whenfollowRedirect
is enabled. For redirect requests, sensitive headersfollowRedirect
are removed from the initialized request when redirecting to a different domain, they can be re-added globally viaHttpClient.followRedirect(boolean, Consumer)
/HttpClient.followRedirect(BiPredicate, Consumer)
or alternatively for full control per redirect request, consider usingHttpClient.RedirectSendHandler
.HttpClient.RedirectSendHandler
can be used to indicate explicitly that thisBiFunction
has special handling for redirect requests.- Parameters:
sender
- a bifunction given the outgoing request and the sendingNettyOutbound
, returns a publisher that will terminate the request body on complete. ReturnMono.empty()
in case of a request without body.- Returns:
- a new
HttpClient.ResponseReceiver
-
sendForm
default HttpClient.ResponseReceiver<?> sendForm(BiConsumer<? super HttpClientRequest, HttpClientForm> formCallback) 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 viaHttpClientForm.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 whenfollowRedirect
is enabled useHttpClientInfos.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 viaHttpClient.followRedirect(boolean, Consumer)
/HttpClient.followRedirect(BiPredicate, Consumer)
.- Parameters:
formCallback
- called when form generator is created- Returns:
- a new
HttpClient.ResponseReceiver
-
sendForm
HttpClient.ResponseReceiver<?> sendForm(BiConsumer<? super HttpClientRequest, HttpClientForm> formCallback, @Nullable Consumer<Flux<Long>> progress) 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 viaHttpClientForm.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 whenfollowRedirect
is enabled useHttpClientInfos.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 viaHttpClient.followRedirect(boolean, Consumer)
/HttpClient.followRedirect(BiPredicate, Consumer)
.- Parameters:
formCallback
- called when form generator is createdprogress
- called after form is being sent and passed with aFlux
of the latest in-flight or uploaded bytes- Returns:
- a new
HttpClient.ResponseReceiver
-