Top Fields Constructors Methods
io.vertx.core.http.impl

pack-priv Class HttpClientRequestPushPromise

extends HttpClientRequestBase
Class Inheritance
Imports
io.vertx.codegen.annotations.Nullable, io.vertx.core.*, io.vertx.core.buffer.Buffer, io.vertx.core.http.*, io.vertx.core.net.SocketAddress, java.util.function.Function

Author
Julien Viet

Field Summary

Modifier and TypeField and Description
private final MultiMap
private final HttpClientStream
Inherited from io.vertx.core.http.impl.HttpClientRequestBase:
contextserverssl

Constructor Summary

AccessConstructor and Description
public
HttpClientRequestPushPromise(HttpClientStream stream, HttpMethod method, String uri, String host, int port, MultiMap headers)

Method Summary

Modifier and TypeMethod and Description
public Future<HttpClientResponse>
connect()

Implements io.vertx.core.http.HttpClientRequest.connect.

Like connect(Handler) but returns a Future of the asynchronous result

public void
connect(Handler<AsyncResult<HttpClientResponse>>
the response completion handler
handler
)

Implements io.vertx.core.http.HttpClientRequest.connect.

Create an HTTP tunnel to the server.

public HttpConnection
public HttpClientRequest
public HttpClientRequest
public HttpClientRequest
public Future<Void>
end(String
the data chunk
chunk
)

Implements io.vertx.core.http.HttpClientRequest.end.

Same as end(Buffer) but writes a String in UTF-8 encoding

public void
end(String chunk, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.HttpClientRequest.end.

Same as end(String) but with an handler called when the operation completes

public Future<Void>
end(String
the data chunk
chunk
,
String
the encoding
enc
)

Implements io.vertx.core.http.HttpClientRequest.end.

Same as end(Buffer) but writes a String with the specified encoding

public void
end(String chunk, String enc, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.HttpClientRequest.end.

Same as end(String, String) but with an handler called when the operation completes

public Future<Void>
end(Buffer
the data to write
chunk
)

Implements io.vertx.core.http.HttpClientRequest.end.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Same as end() but writes some data to the request body before ending.

public void
end(Buffer chunk, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.HttpClientRequest.end.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Same as end(String) but with an handler called when the operation completes

public Future<Void>
end()

Implements io.vertx.core.http.HttpClientRequest.end.

Ends the request.

public void
end(Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.HttpClientRequest.end.

Same as end() but with an handler called when the operation completes

public HttpClientRequest
public int
public StreamPriority
pack-priv void
public MultiMap
public boolean
public boolean
public int
public HttpClientRequest
putHeader(String
The header name
name
,
String
The header value
value
)

Implements io.vertx.core.http.HttpClientRequest.putHeader.

Put an HTTP header

public HttpClientRequest
public HttpClientRequest
putHeader(String
The header name
name
,
Iterable<String>
The header values
values
)

Implements io.vertx.core.http.HttpClientRequest.putHeader.

Put an HTTP header with multiple values

public HttpClientRequest
public HttpClientRequest
public Future<Void>
sendHead()

Implements io.vertx.core.http.HttpClientRequest.sendHead.

Forces the head of the request to be written before end() is called on the request or any data is written to it.

public HttpClientRequest
sendHead(Handler<AsyncResult<Void>> completionHandler)

Implements io.vertx.core.http.HttpClientRequest.sendHead.

Like sendHead() but with an handler after headers have been sent.

public HttpClientRequest
setChunked(boolean
true if chunked encoding
chunked
)

Implements io.vertx.core.http.HttpClientRequest.setChunked.

If chunked is true then the request will be set into HTTP chunked mode

public HttpClientRequest
setFollowRedirects(boolean
true to follow HTTP redirects
followRedirect
)

Implements io.vertx.core.http.HttpClientRequest.setFollowRedirects.

Set the request to follow HTTP redirects up to HttpClientOptions#getMaxRedirects().

public HttpClientRequest
setMaxRedirects(int
the number of HTTP redirect to follow
maxRedirects
)

Implements io.vertx.core.http.HttpClientRequest.setMaxRedirects.

Set the max number of HTTP redirects this request will follow.

public HttpClientRequest
setWriteQueueMaxSize(int
the max size of the write stream
maxSize
)

Implements io.vertx.core.http.HttpClientRequest.setWriteQueueMaxSize.

Set the maximum size of the write queue to maxSize.

public HttpClientRequest
traceOperation(String
the operation
op
)

Implements io.vertx.core.http.HttpClientRequest.traceOperation.

Set the trace operation of this request.

public String
public HttpVersion
public Future<Void>
write(Buffer
the data to write
data
)

Implements io.vertx.core.streams.WriteStream.write.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Write some data to the stream.

public Future<Void>
write(String
the data chunk
chunk
)

Implements io.vertx.core.http.HttpClientRequest.write.

Write a String to the request body, encoded as UTF-8.

public Future<Void>
write(String
the data chunk
chunk
,
String
the encoding
enc
)

Implements io.vertx.core.http.HttpClientRequest.write.

Write a String to the request body, encoded using the encoding enc.

public void
write(Buffer data, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.streams.WriteStream.write.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Same as write(T) but with an handler called when the operation completes

public void
write(String chunk, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.HttpClientRequest.write.

Same as write(String) but with an handler called when the operation completes

public void
write(String chunk, String enc, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.HttpClientRequest.write.

Same as write(String, String) but with an handler called when the operation completes

public HttpClientRequest
writeCustomFrame(int
the 8-bit frame type
type
,
int
the 8-bit frame flags
flags
,
Buffer
the frame payload
payload
)

Implements io.vertx.core.http.HttpClientRequest.writeCustomFrame.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Write an HTTP/2 frame to the request, allowing to extend the HTTP/2 protocol.

public boolean
writeQueueFull()

Implements io.vertx.core.streams.WriteStream.writeQueueFull.

This will return true if there are more bytes in the write queue than the value set using setWriteQueueMaxSize

Inherited from io.vertx.core.http.impl.HttpClientRequestBase:
absoluteURIauthorityauthoritydataReceivedfailgetHostgetMethodgetPortgetURIhandleExceptionhandlePushhandleResponsemapExceptionpathpushHandlerpushHandlerqueryresetresetresponseresponsesetHostsetMethodsetPortsetTimeoutsetURIstreamIdtimeoutEx

Field Detail

headersback to summary
private final MultiMap headers
streamback to summary
private final HttpClientStream stream

Hides io.vertx.core.http.impl.HttpClientRequestBase.stream.

Constructor Detail

HttpClientRequestPushPromiseback to summary
public HttpClientRequestPushPromise(HttpClientStream stream, HttpMethod method, String uri, String host, int port, MultiMap headers)

Method Detail

connectback to summary
public Future<HttpClientResponse> connect()

Implements io.vertx.core.http.HttpClientRequest.connect.

Doc from io.vertx.core.http.HttpClientRequest.connect.

Like connect(Handler) but returns a Future of the asynchronous result

Annotations
@Override
connectback to summary
public void connect(Handler<AsyncResult<HttpClientResponse>> handler)

Implements io.vertx.core.http.HttpClientRequest.connect.

Doc from io.vertx.core.http.HttpClientRequest.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 HTTP CONNECT method
  • 101 for HTTP/1.1 GET with Upgrade connection header

The handler is called after response headers are received.

Use HttpClientResponse#netSocket to get a NetSocket for interacting more conveniently with the server.

HTTP/1.1 pipe-lined requests are not supported.f

Parameters
handler:Handler<AsyncResult<HttpClientResponse>>

the response completion handler

Annotations
@Override
connectionback to summary
public HttpConnection connection()

Implements io.vertx.core.http.HttpClientRequest.connection.

Returns:HttpConnection

Doc from io.vertx.core.http.HttpClientRequest.connection.

the HttpConnection associated with this request

Annotations
@Override
continueHandlerback to summary
public HttpClientRequest continueHandler(@Nullable Handler<Void> handler)
Annotations
@Override
drainHandlerback to summary
public HttpClientRequest drainHandler(Handler<Void> handler)

Implements io.vertx.core.http.HttpClientRequest.drainHandler.

Annotations
@Override
earlyHintsHandlerback to summary
public HttpClientRequest earlyHintsHandler(@Nullable Handler<MultiMap> handler)
Annotations
@Override
endback to summary
public Future<Void> end(String chunk)

Implements io.vertx.core.http.HttpClientRequest.end.

Doc from io.vertx.core.http.HttpClientRequest.end.

Same as end(Buffer) but writes a String in UTF-8 encoding

Parameters
chunk:String

the data chunk

Returns:Future<Void>

a future completed with the result

Annotations
@Override
endback to summary
public void end(String chunk, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.HttpClientRequest.end.

Doc from io.vertx.core.http.HttpClientRequest.end.

Same as end(String) but with an handler called when the operation completes

Annotations
@Override
endback to summary
public Future<Void> end(String chunk, String enc)

Implements io.vertx.core.http.HttpClientRequest.end.

Doc from io.vertx.core.http.HttpClientRequest.end.

Same as end(Buffer) but writes a String with the specified encoding

Parameters
chunk:String

the data chunk

enc:String

the encoding

Returns:Future<Void>

a future completed with the result

Annotations
@Override
endback to summary
public void end(String chunk, String enc, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.HttpClientRequest.end.

Doc from io.vertx.core.http.HttpClientRequest.end.

Same as end(String, String) but with an handler called when the operation completes

Annotations
@Override
endback to summary
public Future<Void> end(Buffer chunk)

Implements io.vertx.core.http.HttpClientRequest.end.

Doc from io.vertx.core.http.HttpClientRequest.end.

References Deprecated

Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Same as end() but writes some data to the request body before ending. If the request is not chunked and no other data has been written then the Content-Length header will be automatically set

Parameters
chunk:Buffer

Doc from io.vertx.core.streams.WriteStream.end.

the data to write

Returns:Future<Void>

a future completed with the result

Annotations
@Override
endback to summary
public void end(Buffer chunk, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.HttpClientRequest.end.

Doc from io.vertx.core.http.HttpClientRequest.end.

References Deprecated

Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Same as end(String) but with an handler called when the operation completes

Annotations
@Override
endback to summary
public Future<Void> end()

Implements io.vertx.core.http.HttpClientRequest.end.

Doc from io.vertx.core.http.HttpClientRequest.end.

Ends the request. If no data has been written to the request body, and sendHead() 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,

Returns:Future<Void>

a future completed with the result

Annotations
@Override
endback to summary
public void end(Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.HttpClientRequest.end.

Doc from io.vertx.core.http.HttpClientRequest.end.

Same as end() but with an handler called when the operation completes

Annotations
@Override
exceptionHandlerback to summary
public HttpClientRequest exceptionHandler(Handler<Throwable> handler)

Implements io.vertx.core.http.HttpClientRequest.exceptionHandler.

Annotations
@Override
getMaxRedirectsback to summary
public int getMaxRedirects()

Implements io.vertx.core.http.HttpClientRequest.getMaxRedirects.

Returns:int

Doc from io.vertx.core.http.HttpClientRequest.getMaxRedirects.

the maximum number of HTTP redirections to follow

Annotations
@Override
getStreamPriorityback to summary
public StreamPriority getStreamPriority()

Implements io.vertx.core.http.HttpClientRequest.getStreamPriority.

Returns:StreamPriority

Doc from io.vertx.core.http.HttpClientRequest.getStreamPriority.

the priority of the associated HTTP/2 stream for HTTP/2 otherwise null

Annotations
@Override
handleResponseback to summary
pack-priv void handleResponse(Promise<HttpClientResponse> promise, HttpClientResponse resp, long timeoutMs)

Implements abstract io.vertx.core.http.impl.HttpClientRequestBase.handleResponse.

Annotations
@Override
headersback to summary
public MultiMap headers()

Implements io.vertx.core.http.HttpClientRequest.headers.

Returns:MultiMap

Doc from io.vertx.core.http.HttpClientRequest.headers.

The HTTP headers

Annotations
@Override
isChunkedback to summary
public boolean isChunked()

Implements io.vertx.core.http.HttpClientRequest.isChunked.

Returns:boolean

Doc from io.vertx.core.http.HttpClientRequest.isChunked.

Is the request chunked?

Annotations
@Override
isFollowRedirectsback to summary
public boolean isFollowRedirects()

Implements io.vertx.core.http.HttpClientRequest.isFollowRedirects.

Returns:boolean

Doc from io.vertx.core.http.HttpClientRequest.isFollowRedirects.

whether HTTP redirections should be followed

Annotations
@Override
numberOfRedirectionsback to summary
public int numberOfRedirections()

Implements io.vertx.core.http.HttpClientRequest.numberOfRedirections.

Returns:int

Doc from io.vertx.core.http.HttpClientRequest.numberOfRedirections.

the number of followed redirections for the current HTTP request

Annotations
@Override
putHeaderback to summary
public HttpClientRequest putHeader(String name, String value)

Implements io.vertx.core.http.HttpClientRequest.putHeader.

Doc from io.vertx.core.http.HttpClientRequest.putHeader.

Put an HTTP header

Parameters
name:String

The header name

value:String

The header value

Returns:HttpClientRequest

a reference to this, so the API can be used fluently

Annotations
@Override
putHeaderback to summary
public HttpClientRequest putHeader(CharSequence name, CharSequence value)

Implements io.vertx.core.http.HttpClientRequest.putHeader.

Doc from io.vertx.core.http.HttpClientRequest.putHeader.

Like putHeader(String, String) but using CharSequence

Annotations
@Override
putHeaderback to summary
public HttpClientRequest putHeader(String name, Iterable<String> values)

Implements io.vertx.core.http.HttpClientRequest.putHeader.

Doc from io.vertx.core.http.HttpClientRequest.putHeader.

Put an HTTP header with multiple values

Parameters
name:String

The header name

values:Iterable<String>

The header values

Returns:HttpClientRequest

@return a reference to this, so the API can be used fluently

Annotations
@Override
putHeaderback to summary
public HttpClientRequest putHeader(CharSequence name, Iterable<CharSequence> values)

Implements io.vertx.core.http.HttpClientRequest.putHeader.

Doc from io.vertx.core.http.HttpClientRequest.putHeader.

Like putHeader(String, Iterable) but using CharSequence

Annotations
@Override
redirectHandlerback to summary
public HttpClientRequest redirectHandler(@Nullable Function<HttpClientResponse, Future<HttpClientRequest>> handler)
Annotations
@Override
sendHeadback to summary
public Future<Void> sendHead()

Implements io.vertx.core.http.HttpClientRequest.sendHead.

Doc from io.vertx.core.http.HttpClientRequest.sendHead.

Forces the head of the request to be written before end() 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.

Returns:Future<Void>

a reference to this, so the API can be used fluently

Annotations
@Override
sendHeadback to summary
public HttpClientRequest sendHead(Handler<AsyncResult<Void>> completionHandler)

Implements io.vertx.core.http.HttpClientRequest.sendHead.

Doc from io.vertx.core.http.HttpClientRequest.sendHead.

Like sendHead() but with an handler after headers have been sent. The handler will be called with the HttpVersion if it can be determined or null otherwise.

Annotations
@Override
setChunkedback to summary
public HttpClientRequest setChunked(boolean chunked)

Implements io.vertx.core.http.HttpClientRequest.setChunked.

Doc from io.vertx.core.http.HttpClientRequest.setChunked.

If chunked is true then the request will be set into HTTP chunked mode

Parameters
chunked:boolean

true if chunked encoding

Returns:HttpClientRequest

a reference to this, so the API can be used fluently

Annotations
@Override
setFollowRedirectsback to summary
public HttpClientRequest setFollowRedirects(boolean followRedirect)

Implements io.vertx.core.http.HttpClientRequest.setFollowRedirects.

Doc from io.vertx.core.http.HttpClientRequest.setFollowRedirects.

Set the request to follow HTTP redirects up to HttpClientOptions#getMaxRedirects().

Parameters
followRedirect:boolean

true to follow HTTP redirects

Returns:HttpClientRequest

a reference to this, so the API can be used fluently

Annotations
@Override
setMaxRedirectsback to summary
public HttpClientRequest setMaxRedirects(int maxRedirects)

Implements io.vertx.core.http.HttpClientRequest.setMaxRedirects.

Doc from io.vertx.core.http.HttpClientRequest.setMaxRedirects.

Set the max number of HTTP redirects this request will follow. The default is 0 which means no redirects.

Parameters
maxRedirects:int

the number of HTTP redirect to follow

Returns:HttpClientRequest

a reference to this, so the API can be used fluently

Annotations
@Override
setWriteQueueMaxSizeback to summary
public HttpClientRequest setWriteQueueMaxSize(int maxSize)

Implements io.vertx.core.http.HttpClientRequest.setWriteQueueMaxSize.

Doc from io.vertx.core.streams.WriteStream.setWriteQueueMaxSize.

Set the maximum size of the write queue to maxSize. You will still be able to write to the stream even if there is more than maxSize items in the write queue. This is used as an indicator by classes such as Pipe to provide flow control.

The value is defined by the implementation of the stream, e.g in bytes for a io.vertx.core.net.NetSocket, etc...

Parameters
maxSize:int

the max size of the write stream

Returns:HttpClientRequest

a reference to this, so the API can be used fluently

Annotations
@Override
traceOperationback to summary
public HttpClientRequest traceOperation(String op)

Implements io.vertx.core.http.HttpClientRequest.traceOperation.

Doc from io.vertx.core.http.HttpClientRequest.traceOperation.

Set the trace operation of this request.

Parameters
op:String

the operation

Returns:HttpClientRequest

@return a reference to this, so the API can be used fluently

Annotations
@Override
traceOperationback to summary
public String traceOperation()

Implements io.vertx.core.http.HttpClientRequest.traceOperation.

Returns:String

Doc from io.vertx.core.http.HttpClientRequest.traceOperation.

the trace operation of this request

Annotations
@Override
versionback to summary
public HttpVersion version()

Implements io.vertx.core.http.HttpClientRequest.version.

Returns:HttpVersion

Doc from io.vertx.core.http.HttpClientRequest.version.

the HTTP version for this request

Annotations
@Override
writeback to summary
public Future<Void> write(Buffer data)

Implements io.vertx.core.streams.WriteStream.write.

Doc from io.vertx.core.streams.WriteStream.write.

References Deprecated

Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

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 a Pipe.

When the data is moved from the queue to the actual medium, the returned Future will be completed with the write result, e.g the future 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.

Parameters
data:Buffer

the data to write

Returns:Future<Void>

a future completed with the write result

Annotations
@Override
writeback to summary
public Future<Void> write(String chunk)

Implements io.vertx.core.http.HttpClientRequest.write.

Doc from io.vertx.core.http.HttpClientRequest.write.

Write a String to the request body, encoded as UTF-8.

Parameters
chunk:String

the data chunk

Returns:Future<Void>

a future completed with the result

Annotations
@Override
writeback to summary
public Future<Void> write(String chunk, String enc)

Implements io.vertx.core.http.HttpClientRequest.write.

Doc from io.vertx.core.http.HttpClientRequest.write.

Write a String to the request body, encoded using the encoding enc.

Parameters
chunk:String

the data chunk

enc:String

the encoding

Returns:Future<Void>

a future completed with the result

Annotations
@Override
writeback to summary
public void write(Buffer data, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.streams.WriteStream.write.

Doc from io.vertx.core.streams.WriteStream.write.

References Deprecated

Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Same as write(T) but with an handler called when the operation completes

Annotations
@Override
writeback to summary
public void write(String chunk, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.HttpClientRequest.write.

Doc from io.vertx.core.http.HttpClientRequest.write.

Same as write(String) but with an handler called when the operation completes

Annotations
@Override
writeback to summary
public void write(String chunk, String enc, Handler<AsyncResult<Void>> handler)

Implements io.vertx.core.http.HttpClientRequest.write.

Doc from io.vertx.core.http.HttpClientRequest.write.

Same as write(String, String) but with an handler called when the operation completes

Annotations
@Override
writeCustomFrameback to summary
public HttpClientRequest writeCustomFrame(int type, int flags, Buffer payload)

Implements io.vertx.core.http.HttpClientRequest.writeCustomFrame.

Doc from io.vertx.core.http.HttpClientRequest.writeCustomFrame.

References Deprecated

Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

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 sendHead(Handler) should be used for this purpose.

Parameters
type:int

the 8-bit frame type

flags:int

the 8-bit frame flags

payload:Buffer

the frame payload

Returns:HttpClientRequest

a reference to this, so the API can be used fluently

Annotations
@Override
writeQueueFullback to summary
public boolean writeQueueFull()

Implements io.vertx.core.streams.WriteStream.writeQueueFull.

Doc from io.vertx.core.streams.WriteStream.writeQueueFull.

This will return true if there are more bytes in the write queue than the value set using setWriteQueueMaxSize

Returns:boolean

true if write queue is full

Annotations
@Override