io.vertx.rxjava3.ext.web.client

## Class WebClient

- java.lang.Object
- - io.vertx.rxjava3.ext.web.client.WebClient

- Direct Known Subclasses:
    OAuth2WebClient, WebClientSession

      public class WebClient
      extends Object

  An asynchronous HTTP / HTTP/2 client called `WebClient`.

  The web client makes easy to do HTTP request/response interactions with a web server, and provides advanced features like:

  - Json body encoding / decoding
  - request/response pumping
  - error handling

  The web client does not deprecate the , it is actually based on it and therefore inherits its configuration and great features like pooling. The `HttpClient` should be used when fine grained control over the HTTP requests/response is necessary.

  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<WebClient>` | `__TYPE_ARG`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close the client.
    `static WebClient` | `create(Vertx vertx)` Create a web client using the provided `vertx` instance and default options.
    `static WebClient` | `create(Vertx vertx, WebClientOptions options)` Create a web client using the provided `vertx` instance.
    `HttpRequest<Buffer>` | `delete(int port, String host, String requestURI)` Create an HTTP DELETE request to send to the server at the specified host and port.
    `HttpRequest<Buffer>` | `delete(String requestURI)` Create an HTTP DELETE request to send to the server at the default host and port.
    `HttpRequest<Buffer>` | `delete(String host, String requestURI)` Create an HTTP DELETE request to send to the server at the specified host and default port.
    `HttpRequest<Buffer>` | `deleteAbs(String absoluteURI)` Create an HTTP DELETE request to send to the server using an absolute URI, specifying a response handler to receive the response
    `boolean` | `equals(Object o)`
    `HttpRequest<Buffer>` | `get(int port, String host, String requestURI)` Create an HTTP GET request to send to the server at the specified host and port.
    `HttpRequest<Buffer>` | `get(String requestURI)` Create an HTTP GET request to send to the server at the default host and port.
    `HttpRequest<Buffer>` | `get(String host, String requestURI)` Create an HTTP GET request to send to the server at the specified host and default port.
    `HttpRequest<Buffer>` | `getAbs(String absoluteURI)` Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive the response
    `WebClient` | `getDelegate()`
    `int` | `hashCode()`
    `HttpRequest<Buffer>` | `head(int port, String host, String requestURI)` Create an HTTP HEAD request to send to the server at the specified host and port.
    `HttpRequest<Buffer>` | `head(String requestURI)` Create an HTTP HEAD request to send to the server at the default host and port.
    `HttpRequest<Buffer>` | `head(String host, String requestURI)` Create an HTTP HEAD request to send to the server at the specified host and default port.
    `HttpRequest<Buffer>` | `headAbs(String absoluteURI)` Create an HTTP HEAD request to send to the server using an absolute URI, specifying a response handler to receive the response
    `static WebClient` | `newInstance(WebClient arg)`
    `HttpRequest<Buffer>` | `patch(int port, String host, String requestURI)` Create an HTTP PATCH request to send to the server at the specified host and port.
    `HttpRequest<Buffer>` | `patch(String requestURI)` Create an HTTP PATCH request to send to the server at the default host and port.
    `HttpRequest<Buffer>` | `patch(String host, String requestURI)` Create an HTTP PATCH request to send to the server at the specified host and default port.
    `HttpRequest<Buffer>` | `patchAbs(String absoluteURI)` Create an HTTP PATCH request to send to the server using an absolute URI, specifying a response handler to receive the response
    `HttpRequest<Buffer>` | `post(int port, String host, String requestURI)` Create an HTTP POST request to send to the server at the specified host and port.
    `HttpRequest<Buffer>` | `post(String requestURI)` Create an HTTP POST request to send to the server at the default host and port.
    `HttpRequest<Buffer>` | `post(String host, String requestURI)` Create an HTTP POST request to send to the server at the specified host and default port.
    `HttpRequest<Buffer>` | `postAbs(String absoluteURI)` Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive the response
    `HttpRequest<Buffer>` | `put(int port, String host, String requestURI)` Create an HTTP PUT request to send to the server at the specified host and port.
    `HttpRequest<Buffer>` | `put(String requestURI)` Create an HTTP PUT request to send to the server at the default host and port.
    `HttpRequest<Buffer>` | `put(String host, String requestURI)` Create an HTTP PUT request to send to the server at the specified host and default port.
    `HttpRequest<Buffer>` | `putAbs(String absoluteURI)` Create an HTTP PUT request to send to the server using an absolute URI, specifying a response handler to receive the response
    `HttpRequest<Buffer>` | `request(HttpMethod method, int port, String host, String requestURI)` Create an HTTP request to send to the server at the specified host and port.
    `HttpRequest<Buffer>` | `request(HttpMethod method, RequestOptions options)` Create an HTTP request to send to the server at the specified host and port.
    `HttpRequest<Buffer>` | `request(HttpMethod method, SocketAddress serverAddress, int port, String host, String requestURI)` Like `request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)` using the `serverAddress` parameter to connect to the server instead of the `port` and `host` parameters.
    `HttpRequest<Buffer>` | `request(HttpMethod method, SocketAddress serverAddress, RequestOptions options)` Like `request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)` using the `serverAddress` parameter to connect to the server instead of the `options` parameter.
    `HttpRequest<Buffer>` | `request(HttpMethod method, SocketAddress serverAddress, String requestURI)` Like `request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)` using the `serverAddress` parameter to connect to the server instead of the default port and default host.
    `HttpRequest<Buffer>` | `request(HttpMethod method, SocketAddress serverAddress, String host, String requestURI)` Like `request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)` using the `serverAddress` parameter to connect to the server instead of the default port and `host` parameter.
    `HttpRequest<Buffer>` | `request(HttpMethod method, String requestURI)` Create an HTTP request to send to the server at the default host and port.
    `HttpRequest<Buffer>` | `request(HttpMethod method, String host, String requestURI)` Create an HTTP request to send to the server at the specified host and default port.
    `HttpRequest<Buffer>` | `requestAbs(HttpMethod method, SocketAddress serverAddress, String absoluteURI)` Like `requestAbs(io.vertx.core.http.HttpMethod, java.lang.String)` using the `serverAddress` parameter to connect to the server instead of the `absoluteURI` parameter.
    `HttpRequest<Buffer>` | `requestAbs(HttpMethod method, String absoluteURI)` Create an HTTP request to send to the server using an absolute URI
    `String` | `toString()`
    `static WebClient` | `wrap(HttpClient httpClient)` Wrap an `httpClient` with a web client and default options.
    `static WebClient` | `wrap(HttpClient httpClient, WebClientOptions options)` Wrap an `httpClient` with a web client and default options.

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

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

- - ### Field Detail

    - #### __TYPE_ARG

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

  - ### Constructor Detail

    - #### WebClient

          public WebClient(WebClient delegate)

    - #### WebClient

          public WebClient(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public WebClient getDelegate()

    - #### create

          public static WebClient create(Vertx vertx)

      Create a web client using the provided `vertx` instance and default options.
      Parameters:
        `vertx` - the vertx instance
      Returns:
        the created web client

    - #### create

          public static WebClient create(Vertx vertx,
                                         WebClientOptions options)

      Create a web client using the provided `vertx` instance.
      Parameters:
        `vertx` - the vertx instance
        `options` - the Web Client options
      Returns:
        the created web client

    - #### wrap

          public static WebClient wrap(HttpClient httpClient)

      Wrap an `httpClient` with a web client and default options.
      Parameters:
        `httpClient` - the to wrap
      Returns:
        the web client

    - #### wrap

          public static WebClient wrap(HttpClient httpClient,
                                       WebClientOptions options)

      Wrap an `httpClient` with a web client and default options.

      Only the specific web client portion of the `options` is used, the `HttpClientOptions` of the `httpClient` is reused.

      Parameters:
        `httpClient` - the to wrap
        `options` - the Web Client options
      Returns:
        the web client

    - #### request

          public HttpRequest<Buffer> request(HttpMethod method,
                                             int port,
                                             String host,
                                             String requestURI)

      Create an HTTP request to send to the server at the specified host and port.
      Parameters:
        `method` - the HTTP method
        `port` - the port
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### request

          public HttpRequest<Buffer> request(HttpMethod method,
                                             SocketAddress serverAddress,
                                             int port,
                                             String host,
                                             String requestURI)

      Like `request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)` using the `serverAddress` parameter to connect to the server instead of the `port` and `host` parameters.

      The request host header will still be created from the `port` and `host` parameters.

      Use to connect to a unix domain socket server.

      Parameters:
        `method` -
        `serverAddress` -
        `port` -
        `host` -
        `requestURI` -
      Returns:

    - #### request

          public HttpRequest<Buffer> request(HttpMethod method,
                                             String host,
                                             String requestURI)

      Create an HTTP request to send to the server at the specified host and default port.
      Parameters:
        `method` - the HTTP method
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### request

          public HttpRequest<Buffer> request(HttpMethod method,
                                             SocketAddress serverAddress,
                                             String host,
                                             String requestURI)

      Like `request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)` using the `serverAddress` parameter to connect to the server instead of the default port and `host` parameter.

      The request host header will still be created from the default port and `host` parameter.

      Use to connect to a unix domain socket server.

      Parameters:
        `method` -
        `serverAddress` -
        `host` -
        `requestURI` -
      Returns:

    - #### request

          public HttpRequest<Buffer> request(HttpMethod method,
                                             String requestURI)

      Create an HTTP request to send to the server at the default host and port.
      Parameters:
        `method` - the HTTP method
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### request

          public HttpRequest<Buffer> request(HttpMethod method,
                                             SocketAddress serverAddress,
                                             String requestURI)

      Like `request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)` using the `serverAddress` parameter to connect to the server instead of the default port and default host.

      The request host header will still be created from the default port and default host.

      Use to connect to a unix domain socket server.

      Parameters:
        `method` -
        `serverAddress` -
        `requestURI` -
      Returns:

    - #### request

          public HttpRequest<Buffer> request(HttpMethod method,
                                             RequestOptions options)

      Create an HTTP request to send to the server at the specified host and port.
      Parameters:
        `method` - the HTTP method
        `options` - the request options
      Returns:
        an HTTP client request object

    - #### request

          public HttpRequest<Buffer> request(HttpMethod method,
                                             SocketAddress serverAddress,
                                             RequestOptions options)

      Like `request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)` using the `serverAddress` parameter to connect to the server instead of the `options` parameter.

      The request host header will still be created from the `options` parameter.

      Use to connect to a unix domain socket server.

      Parameters:
        `method` -
        `serverAddress` -
        `options` -
      Returns:

    - #### requestAbs

          public HttpRequest<Buffer> requestAbs(HttpMethod method,
                                                String absoluteURI)

      Create an HTTP request to send to the server using an absolute URI
      Parameters:
        `method` - the HTTP method
        `absoluteURI` - the absolute URI
      Returns:
        an HTTP client request object

    - #### requestAbs

          public HttpRequest<Buffer> requestAbs(HttpMethod method,
                                                SocketAddress serverAddress,
                                                String absoluteURI)

      Like `requestAbs(io.vertx.core.http.HttpMethod, java.lang.String)` using the `serverAddress` parameter to connect to the server instead of the `absoluteURI` parameter.

      The request host header will still be created from the `absoluteURI` parameter.

      Use to connect to a unix domain socket server.

      Parameters:
        `method` -
        `serverAddress` -
        `absoluteURI` -
      Returns:

    - #### get

          public HttpRequest<Buffer> get(String requestURI)

      Create an HTTP GET request to send to the server at the default host and port.
      Parameters:
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### get

          public HttpRequest<Buffer> get(int port,
                                         String host,
                                         String requestURI)

      Create an HTTP GET request to send to the server at the specified host and port.
      Parameters:
        `port` - the port
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### get

          public HttpRequest<Buffer> get(String host,
                                         String requestURI)

      Create an HTTP GET request to send to the server at the specified host and default port.
      Parameters:
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### getAbs

          public HttpRequest<Buffer> getAbs(String absoluteURI)

      Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive the response
      Parameters:
        `absoluteURI` - the absolute URI
      Returns:
        an HTTP client request object

    - #### post

          public HttpRequest<Buffer> post(String requestURI)

      Create an HTTP POST request to send to the server at the default host and port.
      Parameters:
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### post

          public HttpRequest<Buffer> post(int port,
                                          String host,
                                          String requestURI)

      Create an HTTP POST request to send to the server at the specified host and port.
      Parameters:
        `port` - the port
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### post

          public HttpRequest<Buffer> post(String host,
                                          String requestURI)

      Create an HTTP POST request to send to the server at the specified host and default port.
      Parameters:
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### postAbs

          public HttpRequest<Buffer> postAbs(String absoluteURI)

      Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive the response
      Parameters:
        `absoluteURI` - the absolute URI
      Returns:
        an HTTP client request object

    - #### put

          public HttpRequest<Buffer> put(String requestURI)

      Create an HTTP PUT request to send to the server at the default host and port.
      Parameters:
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### put

          public HttpRequest<Buffer> put(int port,
                                         String host,
                                         String requestURI)

      Create an HTTP PUT request to send to the server at the specified host and port.
      Parameters:
        `port` - the port
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### put

          public HttpRequest<Buffer> put(String host,
                                         String requestURI)

      Create an HTTP PUT request to send to the server at the specified host and default port.
      Parameters:
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### putAbs

          public HttpRequest<Buffer> putAbs(String absoluteURI)

      Create an HTTP PUT request to send to the server using an absolute URI, specifying a response handler to receive the response
      Parameters:
        `absoluteURI` - the absolute URI
      Returns:
        an HTTP client request object

    - #### delete

          public HttpRequest<Buffer> delete(String requestURI)

      Create an HTTP DELETE request to send to the server at the default host and port.
      Parameters:
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### delete

          public HttpRequest<Buffer> delete(int port,
                                            String host,
                                            String requestURI)

      Create an HTTP DELETE request to send to the server at the specified host and port.
      Parameters:
        `port` - the port
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### delete

          public HttpRequest<Buffer> delete(String host,
                                            String requestURI)

      Create an HTTP DELETE request to send to the server at the specified host and default port.
      Parameters:
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### deleteAbs

          public HttpRequest<Buffer> deleteAbs(String absoluteURI)

      Create an HTTP DELETE request to send to the server using an absolute URI, specifying a response handler to receive the response
      Parameters:
        `absoluteURI` - the absolute URI
      Returns:
        an HTTP client request object

    - #### patch

          public HttpRequest<Buffer> patch(String requestURI)

      Create an HTTP PATCH request to send to the server at the default host and port.
      Parameters:
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### patch

          public HttpRequest<Buffer> patch(int port,
                                           String host,
                                           String requestURI)

      Create an HTTP PATCH request to send to the server at the specified host and port.
      Parameters:
        `port` - the port
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### patch

          public HttpRequest<Buffer> patch(String host,
                                           String requestURI)

      Create an HTTP PATCH request to send to the server at the specified host and default port.
      Parameters:
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### patchAbs

          public HttpRequest<Buffer> patchAbs(String absoluteURI)

      Create an HTTP PATCH request to send to the server using an absolute URI, specifying a response handler to receive the response
      Parameters:
        `absoluteURI` - the absolute URI
      Returns:
        an HTTP client request object

    - #### head

          public HttpRequest<Buffer> head(String requestURI)

      Create an HTTP HEAD request to send to the server at the default host and port.
      Parameters:
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### head

          public HttpRequest<Buffer> head(int port,
                                          String host,
                                          String requestURI)

      Create an HTTP HEAD request to send to the server at the specified host and port.
      Parameters:
        `port` - the port
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### head

          public HttpRequest<Buffer> head(String host,
                                          String requestURI)

      Create an HTTP HEAD request to send to the server at the specified host and default port.
      Parameters:
        `host` - the host
        `requestURI` - the relative URI
      Returns:
        an HTTP client request object

    - #### headAbs

          public HttpRequest<Buffer> headAbs(String absoluteURI)

      Create an HTTP HEAD request to send to the server using an absolute URI, specifying a response handler to receive the response
      Parameters:
        `absoluteURI` - the absolute URI
      Returns:
        an HTTP client request object

    - #### close

          public void close()

      Close the client. Closing will close down any pooled connections. Clients should always be closed after use.

    - #### newInstance

          public static WebClient newInstance(WebClient arg)

Copyright © 2021 Eclipse. All rights reserved.