io.vertx.reactivex.core.http

## Class HttpClientRequest

- java.lang.Object
- - io.vertx.reactivex.core.Future<HttpClientResponse>
  - - io.vertx.reactivex.core.http.HttpClientRequest

- All Implemented Interfaces:
    StreamBase, WriteStream<Buffer>

      public class HttpClientRequest
      extends Future<HttpClientResponse>
      implements WriteStream<Buffer>

  Represents a client-side HTTP request.

  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, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` 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, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` 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 `Pump` to pump data with flow control.

  An example of using this class is as follows:

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<HttpClientRequest>` | `__TYPE_ARG`

    - ### Fields inherited from class io.vertx.reactivex.core.Future

      `__typeArg_0`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpClientRequest(HttpClientRequest delegate)`
    `HttpClientRequest(Object delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `absoluteURI()`
    `<U> Future<U>` | `compose(java.util.function.Function<HttpClientResponse,Future<U>> mapper)` Compose this future with a `mapper` function.
    `<U> Future<U>` | `compose(java.util.function.Function<HttpClientResponse,Future<U>> successMapper, java.util.function.Function<Throwable,Future<U>> failureMapper)` Compose this future with a `successMapper` and `failureMapper` functions.
    `HttpConnection` | `connection()`
    `HttpClientRequest` | `continueHandler(Handler<Void> handler)` If you send an HTTP request with the header `Expect` set to the value `100-continue` and the server responds with an interim HTTP response with a status code of `100` and a continue handler has been set using this method, then the `handler` will be called.
    `HttpClientRequest` | `drainHandler(Handler<Void> handler)` Set a drain handler on the stream.
    `void` | `end()` Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `void` | `end(Buffer chunk)` Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `void` | `end(Buffer chunk, Handler<AsyncResult<Void>> handler)` Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `void` | `end(Handler<AsyncResult<Void>> handler)` Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `void` | `end(String chunk)` Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `void` | `end(String chunk, Handler<AsyncResult<Void>> handler)` Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `void` | `end(String chunk, String enc)` Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `void` | `end(String chunk, String enc, Handler<AsyncResult<Void>> handler)` Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `boolean` | `equals(Object o)`
    `HttpClientRequest` | `exceptionHandler(Handler<Throwable> handler)` Set an exception handler on the write stream.
    `<U> Future<U>` | `flatMap(java.util.function.Function<HttpClientResponse,Future<U>> mapper)` Alias for `Future.compose(java.util.function.Function<T, io.vertx.reactivex.core.Future<U>>)`.
    `String` | `getAuthority()`
    `HttpClientRequest` | `getDelegate()`
    `StreamPriority` | `getStreamPriority()`
    `int` | `hashCode()`
    `MultiMap` | `headers()`
    `boolean` | `isChunked()`
    `<U> Future<U>` | `map(java.util.function.Function<HttpClientResponse,U> mapper)` Apply a `mapper` function on this future.
    `HttpMethod` | `method()` The HTTP method for the request.
    `HttpClientRequest` | `netSocket()` Get a for the underlying connection of this request.
    `HttpClientRequest` | `netSocket(Handler<AsyncResult<NetSocket>> handler)` Get a for the underlying connection of this request.
    `static HttpClientRequest` | `newInstance(HttpClientRequest arg)`
    `HttpClientRequest` | `onComplete()` Add a handler to be notified of the result.
    `HttpClientRequest` | `onComplete(Handler<AsyncResult<HttpClientResponse>> handler)` Add a handler to be notified of the result.
    `HttpClientRequest` | `onFailure(Handler<Throwable> handler)` Add a handler to be notified of the failed result.
    `HttpClientRequest` | `onSuccess(Handler<HttpClientResponse> handler)` Add a handler to be notified of the succeeded result.
    `Future<HttpClientResponse>` | `otherwise(java.util.function.Function<Throwable,HttpClientResponse> mapper)` Apply a `mapper` function on this future.
    `Future<HttpClientResponse>` | `otherwise(HttpClientResponse value)` Map the failure of a future to a specific `value`.
    `Future<HttpClientResponse>` | `otherwiseEmpty()` Map the failure of a future to `null`.
    `String` | `path()`
    `HttpClientRequest` | `pushHandler(Handler<HttpClientRequest> handler)` Set a push handler for this request. The handler is called when the client receives a push promise from the server.
    `HttpClientRequest` | `putHeader(CharSequence name, CharSequence value)` Like `putHeader(java.lang.String, java.lang.String)` but using CharSequence
    `HttpClientRequest` | `putHeader(CharSequence name, Iterable<CharSequence> values)` Like `putHeader(java.lang.String, java.lang.String)` but using CharSequence
    `HttpClientRequest` | `putHeader(String name, Iterable<String> values)` Put an HTTP header with multiple values
    `HttpClientRequest` | `putHeader(String name, String value)` Put an HTTP header
    `String` | `query()`
    `Future<HttpClientResponse>` | `recover(java.util.function.Function<Throwable,Future<HttpClientResponse>> mapper)` Handles a failure of this Future by returning the result of another Future.
    `boolean` | `reset()` Reset this stream with the error code `0`.
    `boolean` | `reset(long code)` Reset this request: for HTTP/2, this performs send an HTTP/2 reset frame with the specified error `code` for HTTP/1.x, this closes the connection when the current request is inflight When the request has not yet been sent, the request will be aborted and false is returned as indicator.
    `boolean` | `reset(long code, Throwable cause)` Reset this request: for HTTP/2, this performs send an HTTP/2 reset frame with the specified error `code` for HTTP/1.x, this closes the connection when the current request is inflight When the request has not yet been sent, the request will be aborted and false is returned as indicator.
    `HttpClientResponse` | `result()` The result of the operation.
    `Completable` | `rxEnd()` Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `Completable` | `rxEnd(Buffer chunk)` Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `Completable` | `rxEnd(String chunk)` Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `Completable` | `rxEnd(String chunk, String enc)` Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `Single<NetSocket>` | `rxNetSocket()` Get a for the underlying connection of this request.
    `Single<HttpClientResponse>` | `rxOnComplete()` Add a handler to be notified of the result.
    `Completable` | `rxSendHead()` Like `sendHead(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an handler after headers have been sent.
    `Completable` | `rxWrite(Buffer data)` Same as but with an `handler` called when the operation completes
    `Completable` | `rxWrite(String chunk)` Same as `write(io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `Completable` | `rxWrite(String chunk, String enc)` Same as `write(io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `HttpClientRequest` | `sendHead()` Like `sendHead(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an handler after headers have been sent.
    `HttpClientRequest` | `sendHead(Handler<AsyncResult<Void>> completionHandler)` Like `sendHead(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an handler after headers have been sent.
    `HttpClientRequest` | `setAuthority(String authority)` For HTTP/2 it sets the pseudo header otherwise it sets the header
    `HttpClientRequest` | `setChunked(boolean chunked)` If chunked is true then the request will be set into HTTP chunked mode
    `HttpClientRequest` | `setFollowRedirects(boolean followRedirects)` Set the request to follow HTTP redirects up to `HttpClientOptions`.
    `HttpClientRequest` | `setMaxRedirects(int maxRedirects)` Set the max number of HTTP redirects this request will follow.
    `HttpClientRequest` | `setStreamPriority(StreamPriority streamPriority)` Sets the priority of the associated stream.
    `HttpClientRequest` | `setTimeout(long timeoutMs)` Set's the amount of time after which if the request does not return any data within the timeout period an `TimeoutException` will be passed to the exception handler (if provided) and the request will be closed.
    `HttpClientRequest` | `setWriteQueueMaxSize(int maxSize)` Set the maximum size of the write queue to `maxSize`.
    `int` | `streamId()`
    `io.vertx.reactivex.WriteStreamObserver<Buffer>` | `toObserver()`
    `String` | `toString()`
    `io.vertx.reactivex.WriteStreamSubscriber<Buffer>` | `toSubscriber()`
    `String` | `uri()`
    `HttpVersion` | `version()`
    `void` | `write(Buffer data)` Same as but with an `handler` called when the operation completes
    `void` | `write(Buffer data, Handler<AsyncResult<Void>> handler)` Same as but with an `handler` called when the operation completes
    `void` | `write(String chunk)` Same as `write(io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `void` | `write(String chunk, Handler<AsyncResult<Void>> handler)` Same as `write(io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `void` | `write(String chunk, String enc)` Same as `write(io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `void` | `write(String chunk, String enc, Handler<AsyncResult<Void>> handler)` Same as `write(io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
    `HttpClientRequest` | `writeCustomFrame(HttpFrame frame)` Like `writeCustomFrame(int, int, io.vertx.reactivex.core.buffer.Buffer)` but with an `HttpFrame`.
    `HttpClientRequest` | `writeCustomFrame(int type, int flags, Buffer payload)` Write an HTTP/2 frame to the request, allowing to extend the HTTP/2 protocol.
    `boolean` | `writeQueueFull()` This will return `true` if there are more bytes in the write queue than the value set using `setWriteQueueMaxSize(int)`

    - ### Methods inherited from class io.vertx.reactivex.core.Future

      `cause, context, failed, failedFuture, failedFuture, future, isComplete, map, mapEmpty, newInstance, newInstance, succeeded, succeededFuture, succeededFuture`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface io.vertx.reactivex.core.streams.WriteStream

      `newInstance, newInstance`

    - ### Methods inherited from interface io.vertx.reactivex.core.streams.StreamBase

      `newInstance`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<HttpClientRequest> __TYPE_ARG

  - ### Constructor Detail

    - #### HttpClientRequest

          public HttpClientRequest(HttpClientRequest delegate)

    - #### HttpClientRequest

          public HttpClientRequest(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Future<HttpClientResponse>`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Future<HttpClientResponse>`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Future<HttpClientResponse>`

    - #### getDelegate

          public HttpClientRequest getDelegate()

      Specified by:
        `getDelegate` in interface `StreamBase`
      Specified by:
        `getDelegate` in interface `WriteStream<Buffer>`
      Overrides:
        `getDelegate` in class `Future<HttpClientResponse>`

    - #### toObserver

          public io.vertx.reactivex.WriteStreamObserver<Buffer> toObserver()

    - #### toSubscriber

          public io.vertx.reactivex.WriteStreamSubscriber<Buffer> toSubscriber()

    - #### write

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

      Same as but with an `handler` called when the operation completes
      Specified by:
        `write` in interface `WriteStream<Buffer>`
      Parameters:
        `data` -
        `handler` -

    - #### write

          public void write(Buffer data)

      Same as but with an `handler` called when the operation completes
      Specified by:
        `write` in interface `WriteStream<Buffer>`
      Parameters:
        `data` -

    - #### rxWrite

          public Completable rxWrite(Buffer data)

      Same as but with an `handler` called when the operation completes
      Specified by:
        `rxWrite` in interface `WriteStream<Buffer>`
      Parameters:
        `data` -
      Returns:

    - #### writeQueueFull

          public boolean writeQueueFull()

      This will return `true` if there are more bytes in the write queue than the value set using `setWriteQueueMaxSize(int)`
      Specified by:
        `writeQueueFull` in interface `WriteStream<Buffer>`
      Returns:
        `true` if write queue is full

    - #### result

          public HttpClientResponse result()

      The result of the operation. This will be null if the operation failed.
      Overrides:
        `result` in class `Future<HttpClientResponse>`
      Returns:
        the result or null if the operation failed.

    - #### flatMap

          public <U> Future<U> flatMap(java.util.function.Function<HttpClientResponse,Future<U>> mapper)

      Alias for `Future.compose(java.util.function.Function<T, io.vertx.reactivex.core.Future<U>>)`.
      Overrides:
        `flatMap` in class `Future<HttpClientResponse>`
      Parameters:
        `mapper` -
      Returns:

    - #### compose

          public <U> Future<U> compose(java.util.function.Function<HttpClientResponse,Future<U>> mapper)

      Compose this future with a `mapper` function.

      When this future (the one on which `compose` is called) succeeds, the `mapper` will be called with the completed value and this mapper returns another future object. This returned future completion will complete the future returned by this method call.

      If the `mapper` throws an exception, the returned future will be failed with this exception.

      When this future fails, the failure will be propagated to the returned future and the `mapper` will not be called.

      Overrides:
        `compose` in class `Future<HttpClientResponse>`
      Parameters:
        `mapper` - the mapper function
      Returns:
        the composed future

    - #### compose

          public <U> Future<U> compose(java.util.function.Function<HttpClientResponse,Future<U>> successMapper,
                                       java.util.function.Function<Throwable,Future<U>> failureMapper)

      Compose this future with a `successMapper` and `failureMapper` functions.

      When this future (the one on which `compose` is called) succeeds, the `successMapper` will be called with the completed value and this mapper returns another future object. This returned future completion will complete the future returned by this method call.

      When this future (the one on which `compose` is called) fails, the `failureMapper` will be called with the failure and this mapper returns another future object. This returned future completion will complete the future returned by this method call.

      If any mapper function throws an exception, the returned future will be failed with this exception.

      Overrides:
        `compose` in class `Future<HttpClientResponse>`
      Parameters:
        `successMapper` - the function mapping the success
        `failureMapper` - the function mapping the failure
      Returns:
        the composed future

    - #### map

          public <U> Future<U> map(java.util.function.Function<HttpClientResponse,U> mapper)

      Apply a `mapper` function on this future.

      When this future succeeds, the `mapper` will be called with the completed value and this mapper returns a value. This value will complete the future returned by this method call.

      If the `mapper` throws an exception, the returned future will be failed with this exception.

      When this future fails, the failure will be propagated to the returned future and the `mapper` will not be called.

      Overrides:
        `map` in class `Future<HttpClientResponse>`
      Parameters:
        `mapper` - the mapper function
      Returns:
        the mapped future

    - #### recover

          public Future<HttpClientResponse> recover(java.util.function.Function<Throwable,Future<HttpClientResponse>> mapper)

      Handles a failure of this Future by returning the result of another Future. If the mapper fails, then the returned future will be failed with this failure.
      Overrides:
        `recover` in class `Future<HttpClientResponse>`
      Parameters:
        `mapper` - A function which takes the exception of a failure and returns a new future.
      Returns:
        A recovered future

    - #### otherwise

          public Future<HttpClientResponse> otherwise(java.util.function.Function<Throwable,HttpClientResponse> mapper)

      Apply a `mapper` function on this future.

      When this future fails, the `mapper` will be called with the completed value and this mapper returns a value. This value will complete the future returned by this method call.

      If the `mapper` throws an exception, the returned future will be failed with this exception.

      When this future succeeds, the result will be propagated to the returned future and the `mapper` will not be called.

      Overrides:
        `otherwise` in class `Future<HttpClientResponse>`
      Parameters:
        `mapper` - the mapper function
      Returns:
        the mapped future

    - #### otherwise

          public Future<HttpClientResponse> otherwise(HttpClientResponse value)

      Map the failure of a future to a specific `value`.

      When this future fails, this `value` will complete the future returned by this method call.

      When this future succeeds, the result will be propagated to the returned future.

      Overrides:
        `otherwise` in class `Future<HttpClientResponse>`
      Parameters:
        `value` - the value that eventually completes the mapped future
      Returns:
        the mapped future

    - #### otherwiseEmpty

          public Future<HttpClientResponse> otherwiseEmpty()

      Map the failure of a future to `null`.

      This is a convenience for `future.otherwise((T) null)`.

      When this future fails, the `null` value will complete the future returned by this method call.

      When this future succeeds, the result will be propagated to the returned future.

      Overrides:
        `otherwiseEmpty` in class `Future<HttpClientResponse>`
      Returns:
        the mapped future

    - #### exceptionHandler

          public HttpClientRequest exceptionHandler(Handler<Throwable> handler)

      Description copied from interface: `WriteStream`
      Set an exception handler on the write stream.
      Specified by:
        `exceptionHandler` in interface `StreamBase`
      Specified by:
        `exceptionHandler` in interface `WriteStream<Buffer>`
      Parameters:
        `handler` - the exception handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### setWriteQueueMaxSize

          public HttpClientRequest setWriteQueueMaxSize(int maxSize)

      Description copied from interface: `WriteStream`
      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 `NetSocket`, etc...
      Specified by:
        `setWriteQueueMaxSize` in interface `WriteStream<Buffer>`
      Parameters:
        `maxSize` - the max size of the write stream
      Returns:
        a reference to this, so the API can be used fluently

    - #### drainHandler

          public HttpClientRequest drainHandler(Handler<Void> handler)

      Description copied from interface: `WriteStream`
      Set 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. See `Pipe` for 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:
        `drainHandler` in interface `WriteStream<Buffer>`
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### setFollowRedirects

          public HttpClientRequest setFollowRedirects(boolean followRedirects)

      Set the request to follow HTTP redirects up to `HttpClientOptions`.
      Parameters:
        `followRedirects` - `true` to follow HTTP redirects
      Returns:
        a reference to this, so the API can be used fluently

    - #### setMaxRedirects

          public HttpClientRequest setMaxRedirects(int maxRedirects)

      Set the max number of HTTP redirects this request will follow. The default is `0` which means no redirects.
      Parameters:
        `maxRedirects` - the number of HTTP redirect to follow
      Returns:
        a reference to this, so the API can be used fluently

    - #### setChunked

          public HttpClientRequest setChunked(boolean chunked)

      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?

    - #### method

          public HttpMethod method()

      The HTTP method for the request.
      Returns:

    - #### absoluteURI

          public String absoluteURI()

      Returns:
        the absolute URI corresponding to the the HTTP request

    - #### uri

          public String uri()

      Returns:
        The URI of the request.

    - #### path

          public String path()

      Returns:
        The path part of the uri. For example /somepath/somemorepath/someresource.foo

    - #### query

          public String query()

      Returns:
        the query part of the uri. For example someparam=32&someotherparam=x

    - #### setAuthority

          public HttpClientRequest setAuthority(String authority)

      For HTTP/2 it sets the pseudo header otherwise it sets the header
      Parameters:
        `authority` -
      Returns:

    - #### getAuthority

          public String getAuthority()

      Returns:
        the request host. For HTTP/2 it returns the pseudo header otherwise it returns the header

    - #### headers

          public MultiMap headers()

      Returns:
        The HTTP headers

    - #### putHeader

          public HttpClientRequest putHeader(String name,
                                             String value)

      Put an HTTP header
      Parameters:
        `name` - The header name
        `value` - The header value
      Returns:
        a reference to this, so the API can be used fluently

    - #### version

          public HttpVersion version()

      Returns:
        the HTTP version for this request

    - #### write

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

      Same as `write(io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Parameters:
        `chunk` -
        `handler` -

    - #### write

          public void write(String chunk)

      Same as `write(io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Parameters:
        `chunk` -

    - #### rxWrite

          public Completable rxWrite(String chunk)

      Same as `write(io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Parameters:
        `chunk` -
      Returns:

    - #### write

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

      Same as `write(io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Parameters:
        `chunk` -
        `enc` -
        `handler` -

    - #### write

          public void write(String chunk,
                            String enc)

      Same as `write(io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Parameters:
        `chunk` -
        `enc` -

    - #### rxWrite

          public Completable rxWrite(String chunk,
                                     String enc)

      Same as `write(io.vertx.reactivex.core.buffer.Buffer, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Parameters:
        `chunk` -
        `enc` -
      Returns:

    - #### continueHandler

          public HttpClientRequest continueHandler(Handler<Void> handler)

      If you send an HTTP request with the header `Expect` set to the value `100-continue` and the server responds with an interim HTTP response with a status code of `100` and a continue handler has been set using this method, then the `handler` will 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 `sendHead(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` method to force the request header to be written before the request has ended.

      Parameters:
        `handler` -
      Returns:
        a reference to this, so the API can be used fluently

    - #### sendHead

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

      Like `sendHead(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` 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.

      Parameters:
        `completionHandler` -
      Returns:

    - #### sendHead

          public HttpClientRequest sendHead()

      Like `sendHead(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` 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.

      Returns:

    - #### rxSendHead

          public Completable rxSendHead()

      Like `sendHead(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` 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.

      Returns:

    - #### end

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

      Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Parameters:
        `chunk` -
        `handler` -

    - #### end

          public void end(String chunk)

      Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Parameters:
        `chunk` -

    - #### rxEnd

          public Completable rxEnd(String chunk)

      Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Parameters:
        `chunk` -
      Returns:

    - #### end

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

      Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Parameters:
        `chunk` -
        `enc` -
        `handler` -

    - #### end

          public void end(String chunk,
                          String enc)

      Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Parameters:
        `chunk` -
        `enc` -

    - #### rxEnd

          public Completable rxEnd(String chunk,
                                   String enc)

      Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Parameters:
        `chunk` -
        `enc` -
      Returns:

    - #### end

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

      Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Specified by:
        `end` in interface `WriteStream<Buffer>`
      Parameters:
        `chunk` -
        `handler` -

    - #### end

          public void end(Buffer chunk)

      Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Specified by:
        `end` in interface `WriteStream<Buffer>`
      Parameters:
        `chunk` -

    - #### rxEnd

          public Completable rxEnd(Buffer chunk)

      Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Specified by:
        `rxEnd` in interface `WriteStream<Buffer>`
      Parameters:
        `chunk` -
      Returns:

    - #### end

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

      Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Specified by:
        `end` in interface `WriteStream<Buffer>`
      Parameters:
        `handler` -

    - #### end

          public void end()

      Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Specified by:
        `end` in interface `WriteStream<Buffer>`

    - #### rxEnd

          public Completable rxEnd()

      Same as `end(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` but with an `handler` called when the operation completes
      Specified by:
        `rxEnd` in interface `WriteStream<Buffer>`
      Returns:

    - #### setTimeout

          public HttpClientRequest setTimeout(long timeoutMs)

      Set's the amount of time after which if the request does not return any data within the timeout period an `TimeoutException` will be passed to the exception handler (if provided) and the request will be closed.

      Calling this method more than once has the effect of canceling any existing timeout and starting the timeout from scratch.

      Parameters:
        `timeoutMs` - The quantity of time in milliseconds.
      Returns:
        a reference to this, so the API can be used fluently

    - #### pushHandler

          public HttpClientRequest pushHandler(Handler<HttpClientRequest> handler)

      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-only `HttpClientRequest`, the following methods can be called:

      - `method()`
      - `uri()`
      - `headers()`
      - `getAuthority()`
      In addition the handler should call the 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

    - #### netSocket

          public HttpClientRequest netSocket(Handler<AsyncResult<NetSocket>> handler)

      Get a for the underlying connection of this request.

      The `handler` is called after the response headers are received.

      This shall be used when using a `HttpMethod` method.

      HTTP/1.1 pipe-lined requests cannot support net socket upgrade.

      Pooled connection is removed from the pool.

      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### netSocket

          public HttpClientRequest netSocket()

      Get a for the underlying connection of this request.

      The `handler` is called after the response headers are received.

      This shall be used when using a `HttpMethod` method.

      HTTP/1.1 pipe-lined requests cannot support net socket upgrade.

      Pooled connection is removed from the pool.

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

    - #### rxNetSocket

          public Single<NetSocket> rxNetSocket()

      Get a for the underlying connection of this request.

      The `handler` is called after the response headers are received.

      This shall be used when using a `HttpMethod` method.

      HTTP/1.1 pipe-lined requests cannot support net socket upgrade.

      Pooled connection is removed from the pool.

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

    - #### reset

          public boolean reset()

      Reset this stream with the error code `0`.
      Returns:

    - #### reset

          public boolean reset(long code)

      Reset this request:

      - for HTTP/2, this performs send an HTTP/2 reset frame with the specified error `code`
      - for HTTP/1.x, this closes the connection when the current request is inflight

      When the request has not yet been sent, the request will be aborted and false is returned as indicator.

      Parameters:
        `code` - the error code
      Returns:
        true when reset has been performed

    - #### reset

          public boolean reset(long code,
                               Throwable cause)

      Reset this request:

      - for HTTP/2, this performs send an HTTP/2 reset frame with the specified error `code`
      - for HTTP/1.x, this closes the connection when the current request is inflight

      When the request has not yet been sent, the request will be aborted and false is returned as indicator.

      Parameters:
        `code` - the error code
        `cause` - an optional cause that can be attached to the error code
      Returns:
        true when reset has been performed

    - #### connection

          public HttpConnection connection()

      Returns:
        the `HttpConnection` associated with this request

    - #### writeCustomFrame

          public HttpClientRequest writeCustomFrame(int type,
                                                    int flags,
                                                    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 `sendHead(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` should be used for this purpose.

      Parameters:
        `type` - the 8-bit frame type
        `flags` - the 8-bit frame flags
        `payload` - 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

          public HttpClientRequest writeCustomFrame(HttpFrame frame)

      Like `writeCustomFrame(int, int, io.vertx.reactivex.core.buffer.Buffer)` but with an `HttpFrame`.
      Parameters:
        `frame` - the frame to write
      Returns:

    - #### setStreamPriority

          public HttpClientRequest setStreamPriority(StreamPriority streamPriority)

      Sets the priority of the associated stream.

      This is not implemented for HTTP/1.x.
      Parameters:
        `streamPriority` - the priority of this request's stream
      Returns:

    - #### getStreamPriority

          public StreamPriority getStreamPriority()

      Returns:
        the priority of the associated HTTP/2 stream for HTTP/2 otherwise `null`

    - #### onComplete

          public HttpClientRequest onComplete(Handler<AsyncResult<HttpClientResponse>> handler)

      Description copied from class: `Future`
      Add a handler to be notified of the result.
      Overrides:
        `onComplete` in class `Future<HttpClientResponse>`
      Parameters:
        `handler` - the handler that will be called with the result
      Returns:
        a reference to this, so it can be used fluently

    - #### onComplete

          public HttpClientRequest onComplete()

      Description copied from class: `Future`
      Add a handler to be notified of the result.
      Overrides:
        `onComplete` in class `Future<HttpClientResponse>`
      Returns:
        a reference to this, so it can be used fluently

    - #### rxOnComplete

          public Single<HttpClientResponse> rxOnComplete()

      Description copied from class: `Future`
      Add a handler to be notified of the result.
      Overrides:
        `rxOnComplete` in class `Future<HttpClientResponse>`
      Returns:
        a reference to this, so it can be used fluently

    - #### onSuccess

          public HttpClientRequest onSuccess(Handler<HttpClientResponse> handler)

      Description copied from class: `Future`
      Add a handler to be notified of the succeeded result.
      Overrides:
        `onSuccess` in class `Future<HttpClientResponse>`
      Parameters:
        `handler` - the handler that will be called with the succeeded result
      Returns:
        a reference to this, so it can be used fluently

    - #### onFailure

          public HttpClientRequest onFailure(Handler<Throwable> handler)

      Description copied from class: `Future`
      Add a handler to be notified of the failed result.
      Overrides:
        `onFailure` in class `Future<HttpClientResponse>`
      Parameters:
        `handler` - the handler that will be called with the failed result
      Returns:
        a reference to this, so it can be used fluently

    - #### putHeader

          public HttpClientRequest putHeader(CharSequence name,
                                             CharSequence value)

      Like `putHeader(java.lang.String, java.lang.String)` but using CharSequence
      Parameters:
        `name` -
        `value` -
      Returns:

    - #### putHeader

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

      Put an HTTP header with multiple values
      Parameters:
        `name` - The header name
        `values` - The header values
      Returns:
        @return a reference to this, so the API can be used fluently

    - #### putHeader

          public HttpClientRequest putHeader(CharSequence name,
                                             Iterable<CharSequence> values)

      Like `putHeader(java.lang.String, java.lang.String)` but using CharSequence
      Parameters:
        `name` -
        `values` -
      Returns:

    - #### newInstance

          public static HttpClientRequest newInstance(HttpClientRequest arg)

Copyright © 2020 Eclipse. All rights reserved.