public interface HttpClientRequest extends NettyOutbound, HttpInfos
| Modifier and Type | Interface and Description |
|---|---|
static interface |
HttpClientRequest.Form
An HTTP Form builder
|
FILE_CHUNKED_STRATEGY_BUFFER| Modifier and Type | Method and Description |
|---|---|
HttpClientRequest |
addCookie(io.netty.handler.codec.http.cookie.Cookie cookie)
Add an outbound cookie
|
HttpClientRequest |
addHeader(java.lang.CharSequence name,
java.lang.CharSequence value)
Add an outbound http header, appending the value if the header is already set.
|
HttpClientRequest |
chunkedTransfer(boolean chunked)
Set transfer-encoding header
|
default HttpClientRequest |
context(java.util.function.Consumer<NettyContext> contextCallback)
Immediately call the passed callback with a
NettyContext to operate on the
underlying
Channel state. |
HttpClientRequest |
failOnClientError(boolean shouldFail)
Toggle the request to fail in case of a client-side error.
|
HttpClientRequest |
failOnServerError(boolean shouldFail)
Toggle the request to fail in case of a server-side error.
|
HttpClientRequest |
followRedirect()
Enable http status 302 auto-redirect support
|
boolean |
hasSentHeaders()
Return true if headers and status have been sent to the client
|
HttpClientRequest |
header(java.lang.CharSequence name,
java.lang.CharSequence value)
Set an outbound header, replacing any pre-existing value.
|
HttpClientRequest |
headers(io.netty.handler.codec.http.HttpHeaders headers)
Set outbound headers from the passed headers.
|
boolean |
isFollowRedirect()
Return true if redirected will be followed
|
HttpClientRequest |
keepAlive(boolean keepAlive)
set the request keepAlive if true otherwise remove the existing connection keep alive header
|
default HttpClientRequest |
onWriteIdle(long idleTimeout,
java.lang.Runnable onWriteIdle)
Assign a
Runnable to be invoked when writes have become idle for the given
timeout. |
default HttpClientRequest |
options(java.util.function.Consumer<? super NettyPipeline.SendOptions> configurator)
Provide a new
NettyOutbound scoped configuration for sending. |
java.lang.String[] |
redirectedFrom()
Return the previous redirections or empty array
|
io.netty.handler.codec.http.HttpHeaders |
requestHeaders()
Return outbound headers to be sent
|
default reactor.core.publisher.Mono<java.lang.Void> |
send()
Send headers and empty content thus delimiting a full empty body http request
|
reactor.core.publisher.Flux<java.lang.Long> |
sendForm(java.util.function.Consumer<HttpClientRequest.Form> formCallback)
Prepare to send an HTTP Form including Multipart encoded Form which support
chunked file upload.
|
NettyOutbound |
sendHeaders()
Send the headers.
|
WebsocketOutbound |
sendWebsocket()
Upgrade connection to Websocket.
|
WebsocketOutbound |
sendWebsocket(java.lang.String subprotocols)
Upgrade connection to Websocket, negotiating one of the given subprotocol(s).
|
alloc, context, getFileChunkedStrategy, neverComplete, send, sendByteArray, sendFile, sendFile, sendFileChunked, sendGroups, sendObject, sendObject, sendString, sendString, subscribe, then, thencookies, isKeepAlive, isWebsocket, method, path, uri, versionHttpClientRequest addCookie(io.netty.handler.codec.http.cookie.Cookie cookie)
HttpClientRequest addHeader(java.lang.CharSequence name, java.lang.CharSequence value)
name - header namevalue - header valuedefault HttpClientRequest context(java.util.function.Consumer<NettyContext> contextCallback)
NettyOutboundNettyContext to operate on the
underlying
Channel state. This allows for chaining outbound API.context in interface NettyOutboundcontextCallback - context callbackNettyContextHttpClientRequest chunkedTransfer(boolean chunked)
chunked - true if transfer-encoding:chunkeddefault HttpClientRequest options(java.util.function.Consumer<? super NettyPipeline.SendOptions> configurator)
NettyOutboundNettyOutbound scoped configuration for sending. The
NettyPipeline.SendOptions changes will apply to the next written object or
Publisher.options in interface NettyOutboundconfigurator - the callback invoked to retrieve send configurationthis instanceHttpClientRequest followRedirect()
HttpClientRequest failOnClientError(boolean shouldFail)
shouldFail - true if the request should fail in case of client errors.HttpClientRequest failOnServerError(boolean shouldFail)
shouldFail - true if the request should fail in case of server errors.boolean hasSentHeaders()
HttpClientRequest header(java.lang.CharSequence name, java.lang.CharSequence value)
name - headers keyvalue - header valueHttpClientRequest headers(io.netty.handler.codec.http.HttpHeaders headers)
HOST header key. Any pre-existing value for the passed headers will be replaced.headers - a netty headers mapboolean isFollowRedirect()
HttpClientRequest keepAlive(boolean keepAlive)
default HttpClientRequest onWriteIdle(long idleTimeout, java.lang.Runnable onWriteIdle)
NettyOutboundRunnable to be invoked when writes have become idle for the given
timeout. This replaces any previously set idle callback.onWriteIdle in interface NettyOutboundidleTimeout - the idle timeoutonWriteIdle - the idle timeout handlerjava.lang.String[] redirectedFrom()
io.netty.handler.codec.http.HttpHeaders requestHeaders()
default reactor.core.publisher.Mono<java.lang.Void> send()
Mono successful on committed responseNettyOutbound.send(Publisher)reactor.core.publisher.Flux<java.lang.Long> sendForm(java.util.function.Consumer<HttpClientRequest.Form> formCallback)
HttpClientRequest.Form.multipart(boolean).formCallback - called when form generator is createdFlux of latest in-flight or uploaded bytes,NettyOutbound sendHeaders()
NettyOutbound completing when headers have been sent.WebsocketOutbound sendWebsocket()
WebsocketOutbound completing when upgrade is confirmedWebsocketOutbound sendWebsocket(java.lang.String subprotocols)
The negotiated subprotocol cannot be directly accessed on the returned outbound,
as the negotiation hasn't yet occurred. However, the response to this request will
usually allow access to that information (by upgrading it to a websocket outbound
via HttpClientResponse.receiveWebsocket() then calling
WebsocketOutbound.selectedSubprotocol()).
subprotocols - the subprotocol(s) to negotiate, comma-separated, or null if not relevant.
Can be several protocols, separated by a comma, or null if no subprotocol is required.WebsocketOutbound completing when upgrade is confirmed