Class HttpClientRequest
- All Implemented Interfaces:
MutinyDelegate,StreamBase,WriteStream<io.vertx.core.buffer.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() 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() 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.
- Author:
- Tim Fox
- See Also:
-
HttpClientRequest
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.StreamBase
StreamBase.StreamBaseImplNested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.WriteStream
WriteStream.WriteStreamImpl<T> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpClientRequest(io.vertx.core.http.HttpClientRequest delegate) Create a new instance ofHttpClientRequestdelegating to the given (non-null) instance ofHttpClientRequest.HttpClientRequest(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionio.vertx.core.net.HostAndPortauthority(io.vertx.core.net.HostAndPort authority) Override the request authority initially set by the client.io.smallrye.mutiny.Uni<Boolean>cancel()Attempt to cancel the request according to the semantics of the underlying HTTP implementation.Attempt to cancel the request according to the semantics of the underlying HTTP implementation.Attempt to cancel the request according to the semantics of the underlying HTTP implementation.io.smallrye.mutiny.Uni<HttpClientResponse>connect()Create an HTTP tunnel to the server.Create an HTTP tunnel to the server.Create an HTTP tunnel to the server.continueHandler(Runnable handler) If you send an HTTP request with the headerExpectset to the value100-continueand the server responds with an interim HTTP response with a status code of100and a Continue handler has been set using this method, then thehandlerwill be called.drainHandler(Runnable handler) Set a drain handler on the stream.earlyHintsHandler(Consumer<io.vertx.core.MultiMap> handler) If the server responds with an interim HTTP response with a status code of103and a Early Hints handler has been set using this method, then thehandlerwill be called.io.smallrye.mutiny.Uni<Void>end()Ends the request.io.smallrye.mutiny.Uni<Void>end(io.vertx.core.buffer.Buffer chunk) Same asend()but writes some data to the request body before ending.io.smallrye.mutiny.Uni<Void>Same asend(Buffer)but writes a String in UTF-8 encodingio.smallrye.mutiny.Uni<Void>Same asend(Buffer)but writes a String with the specified encodingvoidEnds the request.voidendAndAwait(io.vertx.core.buffer.Buffer chunk) Same asend()but writes some data to the request body before ending.voidendAndAwait(String chunk) Same asend(Buffer)but writes a String in UTF-8 encodingvoidendAndAwait(String chunk, String enc) Same asend(Buffer)but writes a String with the specified encodingEnds the request.endAndForget(io.vertx.core.buffer.Buffer chunk) Same asend()but writes some data to the request body before ending.endAndForget(String chunk) Same asend(Buffer)but writes a String in UTF-8 encodingendAndForget(String chunk, String enc) Same asend(Buffer)but writes a String with the specified encodingbooleanexceptionHandler(Consumer<Throwable> handler) Set an exception handler on the write stream.io.vertx.core.http.HttpClientRequestGet the delegate instance.intio.vertx.core.http.HttpMethodThe HTTP method for the request.io.vertx.core.http.StreamPrioritygetURI()inthashCode()io.vertx.core.MultiMapheaders()idleTimeout(long timeout) Sets the amount of time after which, if the request does not return any data within the timeout period, the request/response is closed and the related futures are failed with aTimeoutException, e.g.booleanbooleanstatic HttpClientRequestnewInstance(io.vertx.core.http.HttpClientRequest delegate) Creates a new instance of theHttpClientRequest.intpath()pushHandler(Consumer<HttpClientRequest> handler) Set a push handler for this request.putHeader(CharSequence name, CharSequence value) LikeputHeader(String, String)but using CharSequenceputHeader(CharSequence name, Iterable<CharSequence> values) LikeputHeader(String, Iterable)but using CharSequencePut an HTTP header with multiple valuesPut an HTTP headerquery()redirectHandler(Function<HttpClientResponse, io.smallrye.mutiny.Uni<HttpClientRequest>> handler) io.smallrye.mutiny.Uni<Void>reset()Reset this stream with the error code0.io.smallrye.mutiny.Uni<Void>reset(long code) Reset this request:io.smallrye.mutiny.Uni<Void>Reset this request:voidReset this stream with the error code0.voidresetAndAwait(long code) Reset this request:voidresetAndAwait(long code, Throwable cause) Reset this request:Reset this stream with the error code0.resetAndForget(long code) Reset this request:resetAndForget(long code, Throwable cause) Reset this request:io.smallrye.mutiny.Uni<HttpClientResponse>response()Unlike the bare Vert.x variant, this method returns aUni.Unlike the bare Vert.x variant, this method returns aHttpClientResponse.Unlike the bare Vert.x variant, this method ignores theHttpClientResponseresult or any failure.io.smallrye.mutiny.Uni<HttpClientResponse>send()Send the request with an empty body.io.smallrye.mutiny.Uni<HttpClientResponse>send(io.vertx.core.buffer.Buffer body) Send the request with a bufferbody.io.smallrye.mutiny.Uni<HttpClientResponse>send(io.vertx.core.http.ClientForm form) Likesend()but with aform.io.smallrye.mutiny.Uni<HttpClientResponse>send(ReadStream<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer> body) Send the request with a streambody.Send the request with an empty body.sendAndAwait(io.vertx.core.buffer.Buffer body) Send the request with a bufferbody.sendAndAwait(io.vertx.core.http.ClientForm form) Likesend()but with aform.sendAndAwait(ReadStream<io.vertx.core.buffer.Buffer> body) Send the request with a streambody.sendAndAwait(String body) Send the request with a stringbody.sendAndAwait(Flow.Publisher<io.vertx.core.buffer.Buffer> body) Send the request with a streambody.Send the request with an empty body.sendAndForget(io.vertx.core.buffer.Buffer body) Send the request with a bufferbody.sendAndForget(io.vertx.core.http.ClientForm form) Likesend()but with aform.sendAndForget(ReadStream<io.vertx.core.buffer.Buffer> body) Send the request with a streambody.sendAndForget(String body) Send the request with a stringbody.sendAndForget(Flow.Publisher<io.vertx.core.buffer.Buffer> body) Send the request with a streambody.io.smallrye.mutiny.Uni<Void>sendHead()Deprecated.voidDeprecated.instead usewriteHead(), this is scheduled for removal in Vert.x 6Deprecated.instead usewriteHead(), this is scheduled for removal in Vert.x 6setChunked(boolean chunked) If chunked is true then the request will be set into HTTP chunked modesetFollowRedirects(boolean followRedirects) Set the request to follow HTTP redirects up toHttpClientOptions#getMaxRedirects().setMaxRedirects(int maxRedirects) Set the max number of HTTP redirects this request will follow.setMethod(io.vertx.core.http.HttpMethod method) Set the HTTP method for this request.setStreamPriority(io.vertx.core.http.StreamPriority streamPriority) Sets the priority of the associated stream.Set the request uri.setWriteQueueMaxSize(int maxSize) Set the maximum size of the write queue tomaxSize.longstreamId()toString()Flow.Subscriber<io.vertx.core.buffer.Buffer>Converts the current write stream to a subscriber.traceOperation(String op) Set the trace operation of this request.io.vertx.core.http.HttpVersionversion()io.smallrye.mutiny.Uni<Void>write(io.vertx.core.buffer.Buffer arg0) Write some data to the stream.io.smallrye.mutiny.Uni<Void>Write aStringto the request body, encoded as UTF-8.io.smallrye.mutiny.Uni<Void>Write aStringto the request body, encoded using the encodingenc.voidwriteAndAwait(io.vertx.core.buffer.Buffer arg0) Write some data to the stream.voidwriteAndAwait(String chunk) Write aStringto the request body, encoded as UTF-8.voidwriteAndAwait(String chunk, String enc) Write aStringto the request body, encoded using the encodingenc.writeAndForget(io.vertx.core.buffer.Buffer arg0) Write some data to the stream.writeAndForget(String chunk) Write aStringto the request body, encoded as UTF-8.writeAndForget(String chunk, String enc) Write aStringto the request body, encoded using the encodingenc.io.smallrye.mutiny.Uni<Void>writeCustomFrame(int type, int flags, io.vertx.core.buffer.Buffer payload) Write an HTTP/2 frame to the request, allowing to extend the HTTP/2 protocol.io.smallrye.mutiny.Uni<Void>writeCustomFrame(io.vertx.core.http.HttpFrame frame) LikewriteCustomFrame(int, int, Buffer)but with anHttpFrame.voidwriteCustomFrameAndAwait(int type, int flags, io.vertx.core.buffer.Buffer payload) Write an HTTP/2 frame to the request, allowing to extend the HTTP/2 protocol.voidwriteCustomFrameAndAwait(io.vertx.core.http.HttpFrame frame) LikewriteCustomFrame(int, int, Buffer)but with anHttpFrame.writeCustomFrameAndForget(int type, int flags, io.vertx.core.buffer.Buffer payload) Write an HTTP/2 frame to the request, allowing to extend the HTTP/2 protocol.writeCustomFrameAndForget(io.vertx.core.http.HttpFrame frame) LikewriteCustomFrame(int, int, Buffer)but with anHttpFrame.io.smallrye.mutiny.Uni<Void>Write the head of the request.voidWrite the head of the request.Write the head of the request.booleanThis will returntrueif there are more bytes in the write queue than the value set usingsetWriteQueueMaxSize(int)
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
HttpClientRequest
public HttpClientRequest(io.vertx.core.http.HttpClientRequest delegate) Create a new instance ofHttpClientRequestdelegating to the given (non-null) instance ofHttpClientRequest. -
HttpClientRequest
-
-
Method Details
-
getDelegate
public io.vertx.core.http.HttpClientRequest getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfaceStreamBase- Specified by:
getDelegatein interfaceWriteStream<io.vertx.core.buffer.Buffer>- Returns:
- the delegate instance
-
write
Write aStringto the request body, encoded as UTF-8.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
chunk- the data chunk- Returns:
- A
Unirepresenting the asynchronous result of this operation. - Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.write(String)
-
writeAndAwait
Write aStringto the request body, encoded as UTF-8.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
chunk- the data chunk- Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.write(String)
-
writeAndForget
Write aStringto the request body, encoded as UTF-8.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
chunk- the data chunk- Returns:
- The current instance to chain operations if needed.
- Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.write(String)
-
write
Write aStringto the request body, encoded using the encodingenc.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
chunk- the data chunkenc- the encoding- Returns:
- A
Unirepresenting the asynchronous result of this operation. - Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.write(String, String)
-
writeAndAwait
Write aStringto the request body, encoded using the encodingenc.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
chunk- the data chunkenc- the encoding- Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.write(String, String)
-
writeAndForget
Write aStringto the request body, encoded using the encodingenc.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
chunk- the data chunkenc- the encoding- Returns:
- The current instance to chain operations if needed.
- Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.write(String, String)
-
sendHead
Deprecated.instead usewriteHead(), this is scheduled for removal in Vert.x 6Forces the head of the request to be written beforeend()is called on the request or any data is written to it.This is normally used to implement HTTP 100-continue handling, see
#continueHandler(io.vertx.core.Handler)for more information.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.sendHead()
-
sendHeadAndAwait
public void sendHeadAndAwait()Deprecated.instead usewriteHead(), this is scheduled for removal in Vert.x 6Forces the head of the request to be written beforeend()is called on the request or any data is written to it.This is normally used to implement HTTP 100-continue handling, see
#continueHandler(io.vertx.core.Handler)for more information.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- See Also:
-
HttpClientRequest.sendHead()
-
sendHeadAndForget
Deprecated.instead usewriteHead(), this is scheduled for removal in Vert.x 6Forces the head of the request to be written beforeend()is called on the request or any data is written to it.This is normally used to implement HTTP 100-continue handling, see
#continueHandler(io.vertx.core.Handler)for more information.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.sendHead()
-
writeHead
Write the head of the request.This can be used to implement HTTP 100-continue handling, see
#continueHandler(io.vertx.core.Handler)for more information.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.writeHead()
-
writeHeadAndAwait
public void writeHeadAndAwait()Write the head of the request.This can be used to implement HTTP 100-continue handling, see
#continueHandler(io.vertx.core.Handler)for more information.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- See Also:
-
HttpClientRequest.writeHead()
-
writeHeadAndForget
Write the head of the request.This can be used to implement HTTP 100-continue handling, see
#continueHandler(io.vertx.core.Handler)for more information.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.writeHead()
-
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:
200for HTTPCONNECTmethod101for HTTP/1.1GETwithUpgradeconnectionheader
The
handleris called after response headers are received.Use
HttpClientResponse.netSocket()to get aNetSocketfor 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. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.connect()
-
connectAndAwait
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:
200for HTTPCONNECTmethod101for HTTP/1.1GETwithUpgradeconnectionheader
The
handleris called after response headers are received.Use
HttpClientResponse.netSocket()to get aNetSocketfor 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
HttpClientResponse. This method awaits indefinitely 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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
HttpClientRequest.connect()
-
connectAndForget
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:
200for HTTPCONNECTmethod101for HTTP/1.1GETwithUpgradeconnectionheader
The
handleris called after response headers are received.Use
HttpClientResponse.netSocket()to get aNetSocketfor interacting more conveniently with the server.HTTP/1.1 pipe-lined requests are not supported.f
Unlike the bare Vert.x variant, this method ignores the
HttpClientResponseresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.connect()
-
response
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.response()
-
responseAndAwait
Unlike the bare Vert.x variant, this method returns a
HttpClientResponse. This method awaits indefinitely 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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
HttpClientRequest.response()
-
responseAndForget
Unlike the bare Vert.x variant, this method ignores the
HttpClientResponseresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.response()
-
send
Send the request with an empty body.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.send()
-
sendAndAwait
Send the request with an empty body.Unlike the bare Vert.x variant, this method returns a
HttpClientResponse. This method awaits indefinitely 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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
HttpClientRequest.send()
-
sendAndForget
Send the request with an empty body.Unlike the bare Vert.x variant, this method ignores the
HttpClientResponseresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.send()
-
send
Send the request with a stringbody.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.send(String)
-
sendAndAwait
Send the request with a stringbody.Unlike the bare Vert.x variant, this method returns a
HttpClientResponse. This method awaits indefinitely 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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
HttpClientRequest.send(String)
-
sendAndForget
Send the request with a stringbody.Unlike the bare Vert.x variant, this method ignores the
HttpClientResponseresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.send(String)
-
send
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientResponse> send(io.vertx.core.buffer.Buffer body) Send the request with a bufferbody.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.send(Buffer)
-
sendAndAwait
Send the request with a bufferbody.Unlike the bare Vert.x variant, this method returns a
HttpClientResponse. This method awaits indefinitely 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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
HttpClientRequest.send(Buffer)
-
sendAndForget
Send the request with a bufferbody.Unlike the bare Vert.x variant, this method ignores the
HttpClientResponseresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.send(Buffer)
-
send
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientResponse> send(io.vertx.core.http.ClientForm form) Likesend()but with aform. The content will be set toapplication/x-www-form-urlencodedormultipart/form-dataaccording to the nature of the form.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
form- the form to send- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.send(ClientForm)
-
sendAndAwait
Likesend()but with aform. The content will be set toapplication/x-www-form-urlencodedormultipart/form-dataaccording to the nature of the form.Unlike the bare Vert.x variant, this method returns a
HttpClientResponse. This method awaits indefinitely 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 aRuntimeException).- Parameters:
form- the form to send- Returns:
- The operation result
- See Also:
-
HttpClientRequest.send(ClientForm)
-
sendAndForget
Likesend()but with aform. The content will be set toapplication/x-www-form-urlencodedormultipart/form-dataaccording to the nature of the form.Unlike the bare Vert.x variant, this method ignores the
HttpClientResponseresult or any failure.- Parameters:
form- the form to send- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.send(ClientForm)
-
send
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientResponse> send(ReadStream<io.vertx.core.buffer.Buffer> body) Send the request with a streambody.If the
HttpHeaders.CONTENT_LENGTHis set then the request assumes this is the length of the {stream}, otherwise the request will set a chunkedHttpHeaders.CONTENT_ENCODING.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
io.vertx.core.http.HttpClientRequest#send(ReadStream)
-
sendAndAwait
Send the request with a streambody.If the
HttpHeaders.CONTENT_LENGTHis set then the request assumes this is the length of the {stream}, otherwise the request will set a chunkedHttpHeaders.CONTENT_ENCODING.Unlike the bare Vert.x variant, this method returns a
HttpClientResponse. This method awaits indefinitely 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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
io.vertx.core.http.HttpClientRequest#send(ReadStream)
-
sendAndForget
Send the request with a streambody.If the
HttpHeaders.CONTENT_LENGTHis set then the request assumes this is the length of the {stream}, otherwise the request will set a chunkedHttpHeaders.CONTENT_ENCODING.Unlike the bare Vert.x variant, this method ignores the
HttpClientResponseresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
io.vertx.core.http.HttpClientRequest#send(ReadStream)
-
send
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientResponse> send(Flow.Publisher<io.vertx.core.buffer.Buffer> body) Send the request with a streambody.If the
HttpHeaders.CONTENT_LENGTHis set then the request assumes this is the length of the {stream}, otherwise the request will set a chunkedHttpHeaders.CONTENT_ENCODING.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
io.vertx.core.http.HttpClientRequest#send(ReadStream)
-
sendAndAwait
Send the request with a streambody.If the
HttpHeaders.CONTENT_LENGTHis set then the request assumes this is the length of the {stream}, otherwise the request will set a chunkedHttpHeaders.CONTENT_ENCODING.Unlike the bare Vert.x variant, this method returns a
HttpClientResponse. This method awaits indefinitely 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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
io.vertx.core.http.HttpClientRequest#send(ReadStream)
-
sendAndForget
Send the request with a streambody.If the
HttpHeaders.CONTENT_LENGTHis set then the request assumes this is the length of the {stream}, otherwise the request will set a chunkedHttpHeaders.CONTENT_ENCODING.Unlike the bare Vert.x variant, this method ignores the
HttpClientResponseresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
io.vertx.core.http.HttpClientRequest#send(ReadStream)
-
end
Same asend(Buffer)but writes a String in UTF-8 encodingUnlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
chunk- the data chunk- Returns:
- A
Unirepresenting the asynchronous result of this operation. - Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.end(String)
-
endAndAwait
Same asend(Buffer)but writes a String in UTF-8 encodingUnlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
chunk- the data chunk- Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.end(String)
-
endAndForget
Same asend(Buffer)but writes a String in UTF-8 encodingUnlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
chunk- the data chunk- Returns:
- The current instance to chain operations if needed.
- Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.end(String)
-
end
Same asend(Buffer)but writes a String with the specified encodingUnlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
chunk- the data chunkenc- the encoding- Returns:
- A
Unirepresenting the asynchronous result of this operation. - Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.end(String, String)
-
endAndAwait
Same asend(Buffer)but writes a String with the specified encodingUnlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
chunk- the data chunkenc- the encoding- Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.end(String, String)
-
endAndForget
Same asend(Buffer)but writes a String with the specified encodingUnlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
chunk- the data chunkenc- the encoding- Returns:
- The current instance to chain operations if needed.
- Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.end(String, String)
-
end
Same asend()but writes some data to the request body before ending. If the request is not chunked and no other data has been written then theContent-Lengthheader will be automatically setUnlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
endin interfaceWriteStream<io.vertx.core.buffer.Buffer>- Parameters:
chunk- the data to write- Returns:
- A
Unirepresenting the asynchronous result of this operation. - Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.end(Buffer)
-
endAndAwait
public void endAndAwait(io.vertx.core.buffer.Buffer chunk) Same asend()but writes some data to the request body before ending. If the request is not chunked and no other data has been written then theContent-Lengthheader will be automatically setUnlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.end(Buffer)
-
endAndForget
Same asend()but writes some data to the request body before ending. If the request is not chunked and no other data has been written then theContent-Lengthheader will be automatically setUnlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.end(Buffer)
-
end
Ends the request. If no data has been written to the request body, andwriteHead()has not been called then the actual request won't get written until this method gets called.Once the request has ended, it cannot be used any more,
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
endin interfaceWriteStream<io.vertx.core.buffer.Buffer>- Returns:
- A
Unirepresenting the asynchronous result of this operation. - Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.end()
-
endAndAwait
public void endAndAwait()Ends the request. If no data has been written to the request body, andwriteHead()has not been called then the actual request won't get written until this method gets called.Once the request has ended, it cannot be used any more,
Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.end()
-
endAndForget
Ends the request. If no data has been written to the request body, andwriteHead()has not been called then the actual request won't get written until this method gets called.Once the request has ended, it cannot be used any more,
Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- Throws:
when- no response handler is set- See Also:
-
HttpClientRequest.end()
-
reset
Reset this stream with the error code0.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
reset(long)HttpClientRequest.reset()
-
resetAndAwait
public void resetAndAwait()Reset this stream with the error code0.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- See Also:
-
reset(long)HttpClientRequest.reset()
-
resetAndForget
Reset this stream with the error code0.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
reset(long)HttpClientRequest.reset()
-
reset
Reset this request:- for HTTP/1.x, this closes the connection when the current request is inflight
- for HTTP/2, this performs send an HTTP/2 reset frame with the specified error
code - for HTTP/3, this is only effective if the stream has not been fully sent
Stream reset should be avoided because the implementation works partially for HTTP/3 and reset error codes depends on the version of the protocol,
cancel()should be used instead.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
code- the error code- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.reset(long)
-
resetAndAwait
public void resetAndAwait(long code) Reset this request:- for HTTP/1.x, this closes the connection when the current request is inflight
- for HTTP/2, this performs send an HTTP/2 reset frame with the specified error
code - for HTTP/3, this is only effective if the stream has not been fully sent
Stream reset should be avoided because the implementation works partially for HTTP/3 and reset error codes depends on the version of the protocol,
cancel()should be used instead.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
code- the error code- See Also:
-
HttpClientRequest.reset(long)
-
resetAndForget
Reset this request:- for HTTP/1.x, this closes the connection when the current request is inflight
- for HTTP/2, this performs send an HTTP/2 reset frame with the specified error
code - for HTTP/3, this is only effective if the stream has not been fully sent
Stream reset should be avoided because the implementation works partially for HTTP/3 and reset error codes depends on the version of the protocol,
cancel()should be used instead.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
code- the error code- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.reset(long)
-
cancel
Attempt to cancel the request according to the semantics of the underlying HTTP implementation.- for HTTP/1.x, this closes the connection when the current request is inflight
- for HTTP/2, this performs send an HTTP/2 reset frame with the error
0x08 - for HTTP/3, this resets or abort reading the underlying QUIC stream with code
0x10c
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.cancel()
-
cancelAndAwait
Attempt to cancel the request according to the semantics of the underlying HTTP implementation.- for HTTP/1.x, this closes the connection when the current request is inflight
- for HTTP/2, this performs send an HTTP/2 reset frame with the error
0x08 - for HTTP/3, this resets or abort reading the underlying QUIC stream with code
0x10c
Unlike the bare Vert.x variant, this method returns a
Boolean. This method awaits indefinitely 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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
HttpClientRequest.cancel()
-
cancelAndForget
Attempt to cancel the request according to the semantics of the underlying HTTP implementation.- for HTTP/1.x, this closes the connection when the current request is inflight
- for HTTP/2, this performs send an HTTP/2 reset frame with the error
0x08 - for HTTP/3, this resets or abort reading the underlying QUIC stream with code
0x10c
Unlike the bare Vert.x variant, this method ignores the
Booleanresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.cancel()
-
reset
Reset this request:- for HTTP/2, send an HTTP/2 reset frame with the specified error
code - for HTTP/1.x, close the connection when the current request is inflight
falseis returned as indicator.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
code- the error codecause- an optional cause that can be attached to the error code- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.reset(long, Throwable)
- for HTTP/2, send an HTTP/2 reset frame with the specified error
-
resetAndAwait
Reset this request:- for HTTP/2, send an HTTP/2 reset frame with the specified error
code - for HTTP/1.x, close the connection when the current request is inflight
falseis returned as indicator.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
code- the error codecause- an optional cause that can be attached to the error code- See Also:
-
HttpClientRequest.reset(long, Throwable)
- for HTTP/2, send an HTTP/2 reset frame with the specified error
-
resetAndForget
Reset this request:- for HTTP/2, send an HTTP/2 reset frame with the specified error
code - for HTTP/1.x, close the connection when the current request is inflight
falseis returned as indicator.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
code- the error codecause- an optional cause that can be attached to the error code- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.reset(long, Throwable)
- for HTTP/2, send an HTTP/2 reset frame with the specified error
-
writeCustomFrame
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> writeCustomFrame(int type, int flags, io.vertx.core.buffer.Buffer payload) Write an HTTP/2 frame to the request, allowing to extend the HTTP/2 protocol.The frame is sent immediatly and is not subject to flow control.
This method must be called after the request headers have been sent and only for the protocol HTTP/2. The
writeHead()should be used for this purpose.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
type- the 8-bit frame typeflags- the 8-bit frame flagspayload- the frame payload- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.writeCustomFrame(int, int, Buffer)
-
writeCustomFrameAndAwait
public void writeCustomFrameAndAwait(int type, int flags, io.vertx.core.buffer.Buffer payload) Write an HTTP/2 frame to the request, allowing to extend the HTTP/2 protocol.The frame is sent immediatly and is not subject to flow control.
This method must be called after the request headers have been sent and only for the protocol HTTP/2. The
writeHead()should be used for this purpose.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
type- the 8-bit frame typeflags- the 8-bit frame flagspayload- the frame payload- See Also:
-
HttpClientRequest.writeCustomFrame(int, int, Buffer)
-
writeCustomFrameAndForget
public HttpClientRequest writeCustomFrameAndForget(int type, int flags, io.vertx.core.buffer.Buffer payload) Write an HTTP/2 frame to the request, allowing to extend the HTTP/2 protocol.The frame is sent immediatly and is not subject to flow control.
This method must be called after the request headers have been sent and only for the protocol HTTP/2. The
writeHead()should be used for this purpose.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
type- the 8-bit frame typeflags- the 8-bit frame flagspayload- the frame payload- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.writeCustomFrame(int, int, Buffer)
-
writeCustomFrame
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> writeCustomFrame(io.vertx.core.http.HttpFrame frame) LikewriteCustomFrame(int, int, Buffer)but with anHttpFrame.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
frame- the frame to write- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.writeCustomFrame(HttpFrame)
-
writeCustomFrameAndAwait
public void writeCustomFrameAndAwait(io.vertx.core.http.HttpFrame frame) LikewriteCustomFrame(int, int, Buffer)but with anHttpFrame.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
frame- the frame to write- See Also:
-
HttpClientRequest.writeCustomFrame(HttpFrame)
-
writeCustomFrameAndForget
LikewriteCustomFrame(int, int, Buffer)but with anHttpFrame.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
frame- the frame to write- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.writeCustomFrame(HttpFrame)
-
write
Write some data to the stream.The data is usually put on an internal write queue, and the write actually happens asynchronously. To avoid running out of memory by putting too much on the write queue, check the
writeQueueFull()method before writing. This is done automatically if using aPipe.When the
datais moved from the queue to the actual medium, the returnedFuturewill be completed with the write result, e.g the uni is succeeded when a server HTTP response buffer is written to the socket and failed if the remote client has closed the socket while the data was still pending for write.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
writein interfaceWriteStream<io.vertx.core.buffer.Buffer>- Parameters:
data- the data to write- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClientRequest.write(T)
-
writeAndAwait
public void writeAndAwait(io.vertx.core.buffer.Buffer arg0) Write some data to the stream.The data is usually put on an internal write queue, and the write actually happens asynchronously. To avoid running out of memory by putting too much on the write queue, check the
writeQueueFull()method before writing. This is done automatically if using aPipe.When the
datais moved from the queue to the actual medium, the returnedFuturewill be completed with the write result, e.g the underlying uni is succeeded when a server HTTP response buffer is written to the socket and failed if the remote client has closed the socket while the data was still pending for write.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
data- the data to write- See Also:
-
HttpClientRequest.write(T)
-
writeAndForget
Write some data to the stream.The data is usually put on an internal write queue, and the write actually happens asynchronously. To avoid running out of memory by putting too much on the write queue, check the
writeQueueFull()method before writing. This is done automatically if using aPipe.When the
datais moved from the queue to the actual medium, the returnedFuturewill be completed with the write result, e.g the underlying uni is succeeded when a server HTTP response buffer is written to the socket and failed if the remote client has closed the socket while the data was still pending for write.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
data- the data to write- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClientRequest.write(T)
-
exceptionHandler
Description copied from interface:WriteStreamSet an exception handler on the write stream.- Specified by:
exceptionHandlerin interfaceStreamBase- Specified by:
exceptionHandlerin interfaceWriteStream<io.vertx.core.buffer.Buffer>- Parameters:
handler- the exception handler. Can benull.- Returns:
- a reference to this, so the API can be used fluently
-
setWriteQueueMaxSize
Description copied from interface:WriteStreamSet the maximum size of the write queue tomaxSize. You will still be able to write to the stream even if there is more thanmaxSizeitems in the write queue. This is used as an indicator by classes such asPipeto provide flow control. The value is defined by the implementation of the stream, e.g in bytes for aNetSocket, etc...- Specified by:
setWriteQueueMaxSizein interfaceWriteStream<io.vertx.core.buffer.Buffer>- Parameters:
maxSize- the max size of the write stream- Returns:
- a reference to this, so the API can be used fluently
-
drainHandler
Description copied from interface:WriteStreamSet a drain handler on the stream. If the write queue is full, then the handler will be called when the write queue is ready to accept buffers again. SeePipefor an example of this being used.The stream implementation defines when the drain handler, for example it could be when the queue size has been reduced to
maxSize / 2.- Specified by:
drainHandlerin interfaceWriteStream<io.vertx.core.buffer.Buffer>- Parameters:
handler- the handler. Can benull.- Returns:
- a reference to this, so the API can be used fluently
-
authority
Override the request authority initially set by the client.- when using HTTP/1.x this overrides the request
hostheader - when using HTTP/2 this sets the
authoritypseudo header
When the port is a negative value, the default scheme port will be used.
According to the protocol, it can set to
null(although it is not common), e.g. an HTTP/2 request can have a null authority when it carries anhostheader.- Parameters:
authority- override the request authority- Returns:
- a reference to this, so the API can be used fluently
- when using HTTP/1.x this overrides the request
-
authority
public io.vertx.core.net.HostAndPort authority()- Returns:
- the current request authority
-
setFollowRedirects
Set the request to follow HTTP redirects up toHttpClientOptions#getMaxRedirects().- Parameters:
followRedirects-trueto 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
Set the max number of HTTP redirects this request will follow. The default is0which means no redirects.- 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
If chunked is true then the request will be set into HTTP chunked mode- 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()The HTTP method for the request. -
setMethod
Set the HTTP method for this request.- 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
Set the request uri.- 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
public io.vertx.core.MultiMap headers()- Returns:
- The HTTP headers
-
putHeader
Put an HTTP header- Parameters:
name- The header namevalue- The header value- Returns:
- a reference to this, so the API can be used fluently
-
putHeader
LikeputHeader(String, String)but using CharSequence -
putHeader
Put an HTTP header with multiple values- Parameters:
name- The header namevalues- The header values- Returns:
-
putHeader
LikeputHeader(String, Iterable)but using CharSequence -
traceOperation
Set the trace operation of this request.- 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
-
continueHandler
If you send an HTTP request with the headerExpectset to the value100-continueand the server responds with an interim HTTP response with a status code of100and a Continue handler has been set using this method, then thehandlerwill be called.You can then continue to write data to the request body and later end it. This is normally used in conjunction with the
writeHead()method to force the request header to be written before the request has ended.- Returns:
- a reference to this, so the API can be used fluently
-
earlyHintsHandler
If the server responds with an interim HTTP response with a status code of103and a Early Hints handler has been set using this method, then thehandlerwill be called.- Returns:
- a reference to this, so the API can be used fluently
-
redirectHandler
public HttpClientRequest redirectHandler(Function<HttpClientResponse, io.smallrye.mutiny.Uni<HttpClientRequest>> handler) -
idleTimeout
Sets the amount of time after which, if the request does not return any data within the timeout period, the request/response is closed and the related futures are failed with aTimeoutException, e.g.Future<HttpClientResponse>orFuture<Buffer>response body.- Parameters:
timeout- the amount of time in milliseconds.- Returns:
- a reference to this, so the API can be used fluently
-
pushHandler
Set a push handler for this request. The handler is called when the client receives a push promise from the server. The handler can be called multiple times, for each push promise. The handler is called with a read-onlyHttpClientRequest, the following methods can be called: In addition the handler should call theresponse()method to set an handler to process the response.- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
connection
- Returns:
- the
HttpConnectionassociated with this request
-
streamId
public long streamId()- Returns:
- the id of the stream of this response, -1 when it is not yet determined, i.e the request has not been yet sent or it is not supported HTTP/1.x
-
setStreamPriority
Sets the priority of the associated stream. This is not implemented for HTTP/1.x.- Parameters:
streamPriority- the priority of this request's stream
-
getStreamPriority
public io.vertx.core.http.StreamPriority getStreamPriority()- Returns:
- the priority of the associated HTTP/2 stream for HTTP/2 otherwise
null
-
writeQueueFull
public boolean writeQueueFull()This will returntrueif there are more bytes in the write queue than the value set usingsetWriteQueueMaxSize(int)- Specified by:
writeQueueFullin interfaceWriteStream<io.vertx.core.buffer.Buffer>- Returns:
trueif write queue is full
-
newInstance
Creates a new instance of theHttpClientRequest. -
hashCode
public int hashCode() -
equals
-
toString
-
toSubscriber
Converts the current write stream to a subscriber.
-
writeHead(), this is scheduled for removal in Vert.x 6