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 theNettyOutboundsending builder and returning aPublisherto 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, responseSingleMethods 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
Publisherpassed in will be invoked also for redirect requests whenfollowRedirectis enabled. If you need to control what will be sent whenfollowRedirectis enabled then usesend(BiFunction).Note: For redirect requests, sensitive headers
followRedirectare 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.RedirectSendHandlerwithsend(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 theNettyOutboundsending builder and returning aPublisherto signal end of the request.Note: The sender
BiFunctionpassed in will be invoked also for redirect requests whenfollowRedirectis enabled. For redirect requests, sensitive headersfollowRedirectare 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.RedirectSendHandlercan be used to indicate explicitly that thisBiFunctionhas 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
followRedirectis enabled. If you need to control what will be sent whenfollowRedirectis 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
followRedirectare 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
followRedirectis enabled. If you need to control what will be sent whenfollowRedirectis 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
followRedirectare 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 aFluxof the latest in-flight or uploaded bytes- Returns:
- a new
HttpClient.ResponseReceiver
-