Class HttpClientRequest
- All Implemented Interfaces:
MutinyDelegate
,StreamBase
,WriteStream<Buffer>
Instances are created by an HttpClient
instance, via one of the methods corresponding to the
specific HTTP methods, or the generic request methods. On creation the request will not have been written to the
wire.
Once a request has been obtained, headers can be set on it, and data can be written to its body if required. Once
you are ready to send the request, one of the end(java.lang.String)
methods should be called.
Nothing is actually sent until the request has been internally assigned an HTTP connection.
The HttpClient
instance will return an instance of this class immediately, even if there are no HTTP
connections available in the pool. Any requests sent before a connection is assigned will be queued
internally and actually sent when an HTTP connection becomes available from the pool.
The headers of the request are queued for writing either when the end(java.lang.String)
method is called, or, when the first
part of the body is written, whichever occurs first.
This class supports both chunked and non-chunked HTTP.
It implements WriteStream
so it can be used with
Pipe
to pipe data with flow control.
An example of using this class is as follows:
NOTE: This class has been automatically generated from the
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpClientRequest
(io.vertx.core.http.HttpClientRequest delegate) HttpClientRequest
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionauthority
(HostAndPort authority) io.smallrye.mutiny.Uni<HttpClientResponse>
connect()
Create an HTTP tunnel to the server.Blocking variant ofconnect()
.void
Variant ofconnect()
that ignores the result of the operation.continueHandler
(Runnable handler) drainHandler
(Runnable handler) earlyHintsHandler
(Consumer<MultiMap> handler) io.smallrye.mutiny.Uni<Void>
end()
Same asend(java.lang.String)
but with anhandler
called when the operation completesio.smallrye.mutiny.Uni<Void>
Same asend(java.lang.String)
but with anhandler
called when the operation completesio.smallrye.mutiny.Uni<Void>
Same asend(java.lang.String)
but with anhandler
called when the operation completesio.smallrye.mutiny.Uni<Void>
Same asend(java.lang.String)
but with anhandler
called when the operation completesBlocking variant ofend(java.lang.String)
.endAndAwait
(Buffer chunk) Blocking variant ofend(io.vertx.mutiny.core.buffer.Buffer)
.endAndAwait
(String chunk) Blocking variant ofend(String)
.endAndAwait
(String chunk, String enc) Blocking variant ofend(String,String)
.void
Variant ofend(java.lang.String)
that ignores the result of the operation.void
endAndForget
(Buffer chunk) Variant ofend(io.vertx.mutiny.core.buffer.Buffer)
that ignores the result of the operation.void
endAndForget
(String chunk) Variant ofend(String)
that ignores the result of the operation.void
endAndForget
(String chunk, String enc) Variant ofend(String,String)
that ignores the result of the operation.boolean
exceptionHandler
(Consumer<Throwable> handler) io.vertx.core.http.HttpClientRequest
getHost()
Deprecated.int
io.vertx.core.http.HttpMethod
int
getPort()
Deprecated.io.vertx.core.http.StreamPriority
getURI()
int
hashCode()
headers()
idleTimeout
(long timeout) boolean
boolean
static HttpClientRequest
newInstance
(io.vertx.core.http.HttpClientRequest arg) int
path()
pushHandler
(Consumer<HttpClientRequest> handler) putHeader
(CharSequence name, CharSequence value) putHeader
(CharSequence name, Iterable<CharSequence> values) query()
redirectHandler
(Function<HttpClientResponse, io.smallrye.mutiny.Uni<HttpClientRequest>> handler) boolean
reset()
boolean
reset
(long code) boolean
io.smallrye.mutiny.Uni<HttpClientResponse>
response()
Set a callback for the associatedHttpClientResponse
.Blocking variant ofresponse()
.Variant ofresponse()
that ignores the result of the operation.io.smallrye.mutiny.Uni<HttpClientResponse>
send()
Send the request with an empty body.io.smallrye.mutiny.Uni<HttpClientResponse>
Send the request with a bufferbody
.io.smallrye.mutiny.Uni<HttpClientResponse>
send
(ReadStream<Buffer> body) Send the request with a streambody
.io.smallrye.mutiny.Uni<HttpClientResponse>
Send the request with a stringbody
.io.smallrye.mutiny.Uni<HttpClientResponse>
send
(Flow.Publisher<Buffer> body) Send the request with a streambody
.Blocking variant ofsend()
.sendAndAwait
(Buffer body) Blocking variant ofsend(io.vertx.mutiny.core.buffer.Buffer)
.sendAndAwait
(ReadStream<Buffer> body) Blocking variant ofsend(io.vertx.mutiny.core.streams.ReadStream)
.sendAndAwait
(String body) Blocking variant ofsend(String)
.sendAndAwait
(Flow.Publisher<Buffer> body) Blocking variant ofsend(Flow$Publisher)
.void
Variant ofsend()
that ignores the result of the operation.void
sendAndForget
(Buffer body) Variant ofsend(io.vertx.mutiny.core.buffer.Buffer)
that ignores the result of the operation.void
sendAndForget
(ReadStream<Buffer> body) Variant ofsend(io.vertx.mutiny.core.streams.ReadStream)
that ignores the result of the operation.void
sendAndForget
(String body) Variant ofsend(String)
that ignores the result of the operation.void
sendAndForget
(Flow.Publisher<Buffer> body) Variant ofsend(Flow$Publisher)
that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>
sendHead()
LikesendHead()
but with an handler after headers have been sent.Blocking variant ofsendHead()
.Variant ofsendHead()
that ignores the result of the operation.setChunked
(boolean chunked) setFollowRedirects
(boolean followRedirects) Deprecated.setMaxRedirects
(int maxRedirects) setMethod
(io.vertx.core.http.HttpMethod method) setPort
(int port) Deprecated.instead useauthority(HostAndPort)
setStreamPriority
(io.vertx.core.http.StreamPriority streamPriority) setTimeout
(long timeout) Deprecated.instead useidleTimeout(long)
setWriteQueueMaxSize
(int maxSize) int
streamId()
toString()
traceOperation
(String op) io.vertx.core.http.HttpVersion
version()
io.smallrye.mutiny.Uni<Void>
Same as but with anhandler
called when the operation completesio.smallrye.mutiny.Uni<Void>
Same aswrite(io.vertx.mutiny.core.buffer.Buffer)
but with anhandler
called when the operation completesio.smallrye.mutiny.Uni<Void>
Same aswrite(io.vertx.mutiny.core.buffer.Buffer)
but with anhandler
called when the operation completeswriteAndAwait
(Buffer data) Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#write(io.vertx.mutiny.core.buffer.Buffer)
.writeAndAwait
(String chunk) Blocking variant ofwrite(String)
.writeAndAwait
(String chunk, String enc) Blocking variant ofwrite(String,String)
.void
writeAndForget
(Buffer data) Variant ofio.vertx.mutiny.core.streams.WriteStream#write(io.vertx.mutiny.core.buffer.Buffer)
that ignores the result of the operation.void
writeAndForget
(String chunk) Variant ofwrite(String)
that ignores the result of the operation.void
writeAndForget
(String chunk, String enc) Variant ofwrite(String,String)
that ignores the result of the operation.writeCustomFrame
(int type, int flags, Buffer payload) writeCustomFrame
(HttpFrame frame) boolean
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
HttpClientRequest
public HttpClientRequest(io.vertx.core.http.HttpClientRequest delegate) -
HttpClientRequest
-
-
Method Details
-
getDelegate
public io.vertx.core.http.HttpClientRequest getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Specified by:
getDelegate
in interfaceStreamBase
- Specified by:
getDelegate
in interfaceWriteStream<Buffer>
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
toSubscriber
-
write
Same as but with anhandler
called when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Specified by:
write
in interfaceWriteStream<Buffer>
- Parameters:
data
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
writeAndAwait
Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#write(io.vertx.mutiny.core.buffer.Buffer)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
writeAndAwait
in interfaceWriteStream<Buffer>
- Parameters:
data
-- Returns:
- the Void instance produced by the operation.
-
writeAndForget
Variant ofio.vertx.mutiny.core.streams.WriteStream#write(io.vertx.mutiny.core.buffer.Buffer)
that ignores the result of the operation.This method subscribes on the result of
io.vertx.mutiny.core.streams.WriteStream#write(io.vertx.mutiny.core.buffer.Buffer)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromio.vertx.mutiny.core.streams.WriteStream#write(io.vertx.mutiny.core.buffer.Buffer)
but you don't need to compose it with other operations.- Specified by:
writeAndForget
in interfaceWriteStream<Buffer>
- Parameters:
data
-
-
writeQueueFull
public boolean writeQueueFull()- Specified by:
writeQueueFull
in interfaceWriteStream<Buffer>
- Returns:
true
if write queue is full
-
exceptionHandler
- Specified by:
exceptionHandler
in interfaceStreamBase
- Specified by:
exceptionHandler
in interfaceWriteStream<Buffer>
- Parameters:
handler
- the exception handler- Returns:
-
setWriteQueueMaxSize
- Specified by:
setWriteQueueMaxSize
in interfaceWriteStream<Buffer>
- Parameters:
maxSize
- the max size of the write stream- Returns:
- a reference to this, so the API can be used fluently
-
drainHandler
- Specified by:
drainHandler
in interfaceWriteStream<Buffer>
- Parameters:
handler
- the handler- Returns:
-
authority
- Parameters:
authority
- override the request authority- Returns:
- a reference to this, so the API can be used fluently
-
setHost
Deprecated.instead useauthority(HostAndPort)
- Parameters:
host
- the host part of the HTTP/1.1host
header or HTTP/2authority
pseudo header- Returns:
- a reference to this, so the API can be used fluently
-
getHost
Deprecated.- Returns:
- the host value of the HTTP/1.1
host
header or HTTP/2authority
pseudo header
-
setPort
Deprecated.instead useauthority(HostAndPort)
- Parameters:
port
- the port part of the HTTP/1.1host
header or HTTP/2authority
pseudo header- Returns:
- a reference to this, so the API can be used fluently
-
getPort
Deprecated.- Returns:
- the port value of the HTTP/1.1
host
header or HTTP/2authority
pseudo header
-
setFollowRedirects
- Parameters:
followRedirects
-true
to follow HTTP redirects- Returns:
- a reference to this, so the API can be used fluently
-
isFollowRedirects
public boolean isFollowRedirects()- Returns:
- whether HTTP redirections should be followed
-
setMaxRedirects
- Parameters:
maxRedirects
- the number of HTTP redirect to follow- Returns:
- a reference to this, so the API can be used fluently
-
getMaxRedirects
public int getMaxRedirects()- Returns:
- the maximum number of HTTP redirections to follow
-
numberOfRedirections
public int numberOfRedirections()- Returns:
- the number of followed redirections for the current HTTP request
-
setChunked
- Parameters:
chunked
- true if chunked encoding- Returns:
- a reference to this, so the API can be used fluently
-
isChunked
public boolean isChunked()- Returns:
- Is the request chunked?
-
getMethod
public io.vertx.core.http.HttpMethod getMethod()- Returns:
-
setMethod
- Parameters:
method
- the HTTP method- Returns:
- a reference to this, so the API can be used fluently
-
absoluteURI
- Returns:
- the absolute URI corresponding to the HTTP request
-
getURI
- Returns:
- The URI of the request.
-
setURI
- Parameters:
uri
- the request uri- Returns:
- a reference to this, so the API can be used fluently
-
path
- Returns:
- The path part of the uri. For example /somepath/somemorepath/someresource.foo
-
query
- Returns:
- the query part of the uri. For example someparam=32&someotherparam=x
-
headers
- Returns:
- The HTTP headers
-
putHeader
- Parameters:
name
- The header namevalue
- The header value- Returns:
- a reference to this, so the API can be used fluently
-
traceOperation
- Parameters:
op
- the operation- Returns:
-
traceOperation
- Returns:
- the trace operation of this request
-
version
public io.vertx.core.http.HttpVersion version()- Returns:
- the HTTP version for this request
-
write
Same aswrite(io.vertx.mutiny.core.buffer.Buffer)
but with anhandler
called when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
chunk
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
writeAndAwait
Blocking variant ofwrite(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
chunk
-- Returns:
- the Void instance produced by the operation.
-
writeAndForget
Variant ofwrite(String)
that ignores the result of the operation.This method subscribes on the result of
write(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromwrite(String)
but you don't need to compose it with other operations.- Parameters:
chunk
-
-
write
Same aswrite(io.vertx.mutiny.core.buffer.Buffer)
but with anhandler
called when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
chunk
-enc
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
writeAndAwait
Blocking variant ofwrite(String,String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
chunk
-enc
-- Returns:
- the Void instance produced by the operation.
-
writeAndForget
Variant ofwrite(String,String)
that ignores the result of the operation.This method subscribes on the result of
write(String,String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromwrite(String,String)
but you don't need to compose it with other operations.- Parameters:
chunk
-enc
-
-
continueHandler
- Parameters:
handler
-- Returns:
-
earlyHintsHandler
- Parameters:
handler
-- Returns:
-
redirectHandler
public HttpClientRequest redirectHandler(Function<HttpClientResponse, io.smallrye.mutiny.Uni<HttpClientRequest>> handler) -
sendHead
LikesendHead()
but with an handler after headers have been sent. The handler will be called with theHttpVersion
if it can be determined or null otherwise.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendHeadAndAwait
Blocking variant ofsendHead()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
sendHeadAndForget
Variant ofsendHead()
that ignores the result of the operation.This method subscribes on the result of
sendHead()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsendHead()
but you don't need to compose it with other operations.- Returns:
- the instance of HttpClientRequest to chain method calls.
-
connect
Create an HTTP tunnel to the server.Send HTTP request headers to the server, then configures the transport to exchange raw buffers when the server replies with an appropriate response:
200
for HTTPCONNECT
method101
for HTTP/1.1GET
withUpgrade
connection
header
The
handler
is called after response headers are received.Use
HttpClientResponse.netSocket()
to get a for interacting more conveniently with the server.HTTP/1.1 pipe-lined requests are not supported.f
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
connectAndAwait
Blocking variant ofconnect()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the HttpClientResponse instance produced by the operation.
-
connectAndForget
public void connectAndForget() -
response
Set a callback for the associatedHttpClientResponse
.This method does not modify the current request being sent.
Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
responseAndAwait
Blocking variant ofresponse()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the HttpClientResponse instance produced by the operation.
-
responseAndForget
Variant ofresponse()
that ignores the result of the operation.This method subscribes on the result of
response()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromresponse()
but you don't need to compose it with other operations.- Returns:
- the instance of HttpClientRequest to chain method calls.
-
send
Send the request with an empty body.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendAndAwait
Blocking variant ofsend()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the HttpClientResponse instance produced by the operation.
-
sendAndForget
public void sendAndForget() -
send
Send the request with a stringbody
.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
body
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendAndAwait
Blocking variant ofsend(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
body
-- Returns:
- the HttpClientResponse instance produced by the operation.
-
sendAndForget
Variant ofsend(String)
that ignores the result of the operation.This method subscribes on the result of
send(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsend(String)
but you don't need to compose it with other operations.- Parameters:
body
-
-
send
Send the request with a bufferbody
.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
body
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendAndAwait
Blocking variant ofsend(io.vertx.mutiny.core.buffer.Buffer)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
body
-- Returns:
- the HttpClientResponse instance produced by the operation.
-
sendAndForget
Variant ofsend(io.vertx.mutiny.core.buffer.Buffer)
that ignores the result of the operation.This method subscribes on the result of
send(io.vertx.mutiny.core.buffer.Buffer)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsend(io.vertx.mutiny.core.buffer.Buffer)
but you don't need to compose it with other operations.- Parameters:
body
-
-
send
Send the request with a streambody
.If the
HttpHeaders
is set then the request assumes this is the length of the {stream}, otherwise the request will set a chunkedHttpHeaders
.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
body
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendAndAwait
Blocking variant ofsend(io.vertx.mutiny.core.streams.ReadStream)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
body
-- Returns:
- the HttpClientResponse instance produced by the operation.
-
sendAndForget
Variant ofsend(io.vertx.mutiny.core.streams.ReadStream)
that ignores the result of the operation.This method subscribes on the result of
send(io.vertx.mutiny.core.streams.ReadStream)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsend(io.vertx.mutiny.core.streams.ReadStream)
but you don't need to compose it with other operations.- Parameters:
body
-
-
send
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientResponse> send(Flow.Publisher<Buffer> body) Send the request with a streambody
.If the
HttpHeaders
is set then the request assumes this is the length of the {stream}, otherwise the request will set a chunkedHttpHeaders
.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
body
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendAndAwait
Blocking variant ofsend(Flow$Publisher)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
body
-- Returns:
- the HttpClientResponse instance produced by the operation.
-
sendAndForget
Variant ofsend(Flow$Publisher)
that ignores the result of the operation.This method subscribes on the result of
send(Flow$Publisher)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsend(Flow$Publisher)
but you don't need to compose it with other operations.- Parameters:
body
-
-
end
Same asend(java.lang.String)
but with anhandler
called when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
chunk
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
Blocking variant ofend(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
chunk
-- Returns:
- the Void instance produced by the operation.
-
endAndForget
Variant ofend(String)
that ignores the result of the operation.This method subscribes on the result of
end(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromend(String)
but you don't need to compose it with other operations.- Parameters:
chunk
-
-
end
Same asend(java.lang.String)
but with anhandler
called when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
chunk
-enc
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
Blocking variant ofend(String,String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
chunk
-enc
-- Returns:
- the Void instance produced by the operation.
-
endAndForget
Variant ofend(String,String)
that ignores the result of the operation.This method subscribes on the result of
end(String,String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromend(String,String)
but you don't need to compose it with other operations.- Parameters:
chunk
-enc
-
-
end
Same asend(java.lang.String)
but with anhandler
called when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Specified by:
end
in interfaceWriteStream<Buffer>
- Parameters:
chunk
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
Blocking variant ofend(io.vertx.mutiny.core.buffer.Buffer)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
endAndAwait
in interfaceWriteStream<Buffer>
- Parameters:
chunk
-- Returns:
- the Void instance produced by the operation.
-
endAndForget
Variant ofend(io.vertx.mutiny.core.buffer.Buffer)
that ignores the result of the operation.This method subscribes on the result of
end(io.vertx.mutiny.core.buffer.Buffer)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromend(io.vertx.mutiny.core.buffer.Buffer)
but you don't need to compose it with other operations.- Specified by:
endAndForget
in interfaceWriteStream<Buffer>
- Parameters:
chunk
-
-
end
Same asend(java.lang.String)
but with anhandler
called when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Specified by:
end
in interfaceWriteStream<Buffer>
- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
Blocking variant ofend(java.lang.String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
endAndAwait
in interfaceWriteStream<Buffer>
- Returns:
- the Void instance produced by the operation.
-
endAndForget
public void endAndForget()Variant ofend(java.lang.String)
that ignores the result of the operation.This method subscribes on the result of
end(java.lang.String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromend(java.lang.String)
but you don't need to compose it with other operations.- Specified by:
endAndForget
in interfaceWriteStream<Buffer>
-
setTimeout
Deprecated.instead useidleTimeout(long)
- Parameters:
timeout
-- Returns:
- the instance of HttpClientRequest to chain method calls.
-
idleTimeout
- Parameters:
timeout
- the amount of time in milliseconds.- Returns:
- a reference to this, so the API can be used fluently
-
pushHandler
- Parameters:
handler
- the handler- Returns:
-
reset
public boolean reset()- Returns:
-
reset
public boolean reset(long code) - Parameters:
code
- the error code- Returns:
true
when reset has been performed
-
reset
- Parameters:
code
- the error codecause
- an optional cause that can be attached to the error code- Returns:
- true when reset has been performed
-
connection
- Returns:
- the
HttpConnection
associated with this request
-
writeCustomFrame
- Parameters:
type
- the 8-bit frame typeflags
- the 8-bit frame flagspayload
- the frame payload- Returns:
- a reference to this, so the API can be used fluently
-
streamId
public int streamId()- Returns:
- the id of the stream of this response, when it is not yet determined, i.e the request has not been yet sent or it is not supported HTTP/1.x
-
writeCustomFrame
- Parameters:
frame
- the frame to write- Returns:
- the instance of HttpClientRequest to chain method calls.
-
setStreamPriority
- Parameters:
streamPriority
- the priority of this request's stream- Returns:
- the instance of HttpClientRequest to chain method calls.
-
getStreamPriority
public io.vertx.core.http.StreamPriority getStreamPriority()- Returns:
- the priority of the associated HTTP/2 stream for HTTP/2 otherwise
null
-
putHeader
- Parameters:
name
-value
-- Returns:
- the instance of HttpClientRequest to chain method calls.
-
putHeader
- Parameters:
name
- The header namevalues
- The header values- Returns:
-
putHeader
- Parameters:
name
-values
-- Returns:
- the instance of HttpClientRequest to chain method calls.
-
newInstance
-
authority(HostAndPort)