Class WebClient

java.lang.Object
io.vertx.mutiny.ext.web.client.WebClient
All Implemented Interfaces:
MutinyDelegate
Direct Known Subclasses:
OAuth2WebClient, WebClientSession

public class WebClient extends Object implements MutinyDelegate
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 HttpClient, 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 Mutiny-ified interface.

Author:
Julien Viet
See Also:
  • WebClient
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TypeArg<WebClient>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    WebClient(io.vertx.ext.web.client.WebClient delegate)
    Create a new instance of WebClient delegating to the given (non-null) instance of WebClient.
    WebClient(Object delegate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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, io.vertx.ext.web.client.WebClientConfig config)
    Create a web client using the provided vertx instance and default pooling options.
    static WebClient
    create(Vertx vertx, io.vertx.ext.web.client.WebClientConfig config, io.vertx.core.http.PoolOptions poolOptions)
    Create a web client using the provided vertx instance.
    static WebClient
    create(Vertx vertx, io.vertx.ext.web.client.WebClientConfig config, io.vertx.core.net.ClientSSLOptions sslOptions)
    Create a web client using the provided vertx instance, SSL options and default pooling options.
    static WebClient
    create(Vertx vertx, io.vertx.ext.web.client.WebClientConfig config, io.vertx.core.net.ClientSSLOptions sslOptions, io.vertx.core.http.PoolOptions poolOptions)
    Create a web client using the provided vertx instance and SSL options.
    static WebClient
    create(Vertx vertx, io.vertx.ext.web.client.WebClientOptions options)
    Create a web client using the provided vertx instance and default pooling options.
    static WebClient
    create(Vertx vertx, io.vertx.ext.web.client.WebClientOptions options, io.vertx.core.http.PoolOptions poolOptions)
    Create a web client using the provided vertx instance.
    HttpRequest<io.vertx.core.buffer.Buffer>
    delete(int port, String host, UriTemplate requestURI)
    Create an HTTP DELETE request to send to the server at the specified host and port.
    HttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>
    delete(UriTemplate requestURI)
    Create an HTTP DELETE request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    delete(String requestURI)
    Create an HTTP DELETE request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    delete(String host, UriTemplate requestURI)
    Create an HTTP DELETE request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    delete(String host, String requestURI)
    Create an HTTP DELETE request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    deleteAbs(UriTemplate absoluteURI)
    Create an HTTP DELETE request to send to the server using an absolute URI, specifying a response handler to receive the response
    HttpRequest<io.vertx.core.buffer.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
     
    HttpRequest<io.vertx.core.buffer.Buffer>
    get(int port, String host, UriTemplate requestURI)
    Create an HTTP GET request to send to the server at the specified host and port.
    HttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>
    get(UriTemplate requestURI)
    Create an HTTP GET request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    get(String requestURI)
    Create an HTTP GET request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    get(String host, UriTemplate requestURI)
    Create an HTTP GET request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    get(String host, String requestURI)
    Create an HTTP GET request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    getAbs(UriTemplate absoluteURI)
    Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive the response
    HttpRequest<io.vertx.core.buffer.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
    io.vertx.ext.web.client.WebClient
    Get the delegate instance.
    int
     
    HttpRequest<io.vertx.core.buffer.Buffer>
    head(int port, String host, UriTemplate requestURI)
    Create an HTTP HEAD request to send to the server at the specified host and port.
    HttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>
    head(UriTemplate requestURI)
    Create an HTTP HEAD request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    head(String requestURI)
    Create an HTTP HEAD request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    head(String host, UriTemplate requestURI)
    Create an HTTP HEAD request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    head(String host, String requestURI)
    Create an HTTP HEAD request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    headAbs(UriTemplate absoluteURI)
    Create an HTTP HEAD request to send to the server using an absolute URI, specifying a response handler to receive the response
    HttpRequest<io.vertx.core.buffer.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(io.vertx.ext.web.client.WebClient delegate)
    Creates a new instance of the WebClient.
    HttpRequest<io.vertx.core.buffer.Buffer>
    patch(int port, String host, UriTemplate requestURI)
    Create an HTTP PATCH request to send to the server at the specified host and port.
    HttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>
    patch(UriTemplate requestURI)
    Create an HTTP PATCH request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    patch(String requestURI)
    Create an HTTP PATCH request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    patch(String host, UriTemplate requestURI)
    Create an HTTP PATCH request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    patch(String host, String requestURI)
    Create an HTTP PATCH request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    patchAbs(UriTemplate absoluteURI)
    Create an HTTP PATCH request to send to the server using an absolute URI, specifying a response handler to receive the response
    HttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>
    post(int port, String host, UriTemplate requestURI)
    Create an HTTP POST request to send to the server at the specified host and port.
    HttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>
    post(UriTemplate requestURI)
    Create an HTTP POST request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    post(String requestURI)
    Create an HTTP POST request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    post(String host, UriTemplate requestURI)
    Create an HTTP POST request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    post(String host, String requestURI)
    Create an HTTP POST request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    postAbs(UriTemplate absoluteURI)
    Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive the response
    HttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>
    put(int port, String host, UriTemplate requestURI)
    Create an HTTP PUT request to send to the server at the specified host and port.
    HttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>
    put(UriTemplate requestURI)
    Create an HTTP PUT request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    put(String requestURI)
    Create an HTTP PUT request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    put(String host, UriTemplate requestURI)
    Create an HTTP PUT request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    put(String host, String requestURI)
    Create an HTTP PUT request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    putAbs(UriTemplate absoluteURI)
    Create an HTTP PUT request to send to the server using an absolute URI, specifying a response handler to receive the response
    HttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, int port, String host, UriTemplate requestURI)
    Create an HTTP request to send to the server at the specified host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, int port, String host, String requestURI)
    Create an HTTP request to send to the server at the specified host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, io.vertx.core.http.RequestOptions options)
    Deprecated.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, int port, String host, UriTemplate requestURI)
    Like request(HttpMethod, int, String, UriTemplate) using the serverAddress parameter to connect to the server instead of the port and host parameters.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, int port, String host, String requestURI)
    Like request(HttpMethod, int, String, String) using the serverAddress parameter to connect to the server instead of the port and host parameters.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, io.vertx.core.http.RequestOptions options)
    Deprecated.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, UriTemplate requestURI)
    Like request(HttpMethod, UriTemplate) using the serverAddress parameter to connect to the server instead of the default port and default host.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String requestURI)
    Like request(HttpMethod, String) using the serverAddress parameter to connect to the server instead of the default port and default host.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String host, UriTemplate requestURI)
    Like request(HttpMethod, String, UriTemplate) using the serverAddress parameter to connect to the server instead of the default port and host parameter.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String host, String requestURI)
    Like request(HttpMethod, String, String) using the serverAddress parameter to connect to the server instead of the default port and host parameter.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, UriTemplate requestURI)
    Create an HTTP request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, String requestURI)
    Create an HTTP request to send to the server at the default host and port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, String host, UriTemplate requestURI)
    Create an HTTP request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.HttpMethod method, String host, String requestURI)
    Create an HTTP request to send to the server at the specified host and default port.
    HttpRequest<io.vertx.core.buffer.Buffer>
    request(io.vertx.core.http.RequestOptions options)
    Create an HTTP request to send to the server from the specified request options.
    HttpRequest<io.vertx.core.buffer.Buffer>
    requestAbs(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, UriTemplate absoluteURI)
    Like requestAbs(HttpMethod, UriTemplate) using the serverAddress parameter to connect to the server instead of the absoluteURI parameter.
    HttpRequest<io.vertx.core.buffer.Buffer>
    requestAbs(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String absoluteURI)
    Like requestAbs(HttpMethod, String) using the serverAddress parameter to connect to the server instead of the absoluteURI parameter.
    HttpRequest<io.vertx.core.buffer.Buffer>
    requestAbs(io.vertx.core.http.HttpMethod method, UriTemplate absoluteURI)
    Create an HTTP request to send to the server using an absolute URI
    HttpRequest<io.vertx.core.buffer.Buffer>
    requestAbs(io.vertx.core.http.HttpMethod method, String absoluteURI)
    Create an HTTP request to send to the server using an absolute URI
     
    io.smallrye.mutiny.Uni<Boolean>
    updateSSLOptions(io.vertx.core.net.ClientSSLOptions options)
    Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.
    io.smallrye.mutiny.Uni<Boolean>
    updateSSLOptions(io.vertx.core.net.ClientSSLOptions options, boolean force)
    Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.
    updateSSLOptionsAndAwait(io.vertx.core.net.ClientSSLOptions options)
    Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.
    updateSSLOptionsAndAwait(io.vertx.core.net.ClientSSLOptions options, boolean force)
    Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.
    updateSSLOptionsAndForget(io.vertx.core.net.ClientSSLOptions options)
    Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.
    updateSSLOptionsAndForget(io.vertx.core.net.ClientSSLOptions options, boolean force)
    Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.
    static WebClient
    wrap(HttpClient httpClient)
    Wrap an httpClient with a web client and default options.
    static WebClient
    wrap(HttpClient httpClient, io.vertx.ext.web.client.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 Details

  • Constructor Details

    • WebClient

      public WebClient(io.vertx.ext.web.client.WebClient delegate)
      Create a new instance of WebClient delegating to the given (non-null) instance of WebClient.
    • WebClient

      public WebClient(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.web.client.WebClient getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • updateSSLOptions

      @CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.ClientSSLOptions options)

      Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.

      The boolean succeeded uni result indicates whether the update occurred.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      options - the new SSL options
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • WebClient.updateSSLOptions(ClientSSLOptions)
    • updateSSLOptionsAndAwait

      public Boolean updateSSLOptionsAndAwait(io.vertx.core.net.ClientSSLOptions options)

      Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.

      The boolean succeeded underlying uni result indicates whether the update occurred.

      Unlike the bare Vert.x variant, this method returns a Boolean. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      options - the new SSL options
      Returns:
      The operation result
      See Also:
      • WebClient.updateSSLOptions(ClientSSLOptions)
    • updateSSLOptionsAndForget

      public WebClient updateSSLOptionsAndForget(io.vertx.core.net.ClientSSLOptions options)

      Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.

      The boolean succeeded underlying uni result indicates whether the update occurred.

      Unlike the bare Vert.x variant, this method ignores the Boolean result or any failure.

      Parameters:
      options - the new SSL options
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • WebClient.updateSSLOptions(ClientSSLOptions)
    • updateSSLOptions

      @CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.ClientSSLOptions options, boolean force)

      Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.

      The options object is compared using its equals method against the existing options to prevent an update when the objects are equals since loading options can be costly, this can happen for share TCP servers. When object are equals, setting force to true forces the update.

      The boolean succeeded uni result indicates whether the update occurred.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      options - the new SSL options
      force - force the update when options are equals
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • WebClient.updateSSLOptions(ClientSSLOptions, boolean)
    • updateSSLOptionsAndAwait

      public Boolean updateSSLOptionsAndAwait(io.vertx.core.net.ClientSSLOptions options, boolean force)

      Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.

      The options object is compared using its equals method against the existing options to prevent an update when the objects are equals since loading options can be costly, this can happen for share TCP servers. When object are equals, setting force to true forces the update.

      The boolean succeeded underlying uni result indicates whether the update occurred.

      Unlike the bare Vert.x variant, this method returns a Boolean. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      options - the new SSL options
      force - force the update when options are equals
      Returns:
      The operation result
      See Also:
      • WebClient.updateSSLOptions(ClientSSLOptions, boolean)
    • updateSSLOptionsAndForget

      public WebClient updateSSLOptionsAndForget(io.vertx.core.net.ClientSSLOptions options, boolean force)

      Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.

      The options object is compared using its equals method against the existing options to prevent an update when the objects are equals since loading options can be costly, this can happen for share TCP servers. When object are equals, setting force to true forces the update.

      The boolean succeeded underlying uni result indicates whether the update occurred.

      Unlike the bare Vert.x variant, this method ignores the Boolean result or any failure.

      Parameters:
      options - the new SSL options
      force - force the update when options are equals
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • WebClient.updateSSLOptions(ClientSSLOptions, boolean)
    • 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, io.vertx.ext.web.client.WebClientOptions options)
      Create a web client using the provided vertx instance and default pooling options.
      Parameters:
      vertx - the vertx instance
      options - the Web Client options
      Returns:
      the created web client
    • create

      public static WebClient create(Vertx vertx, io.vertx.ext.web.client.WebClientOptions options, io.vertx.core.http.PoolOptions poolOptions)
      Create a web client using the provided vertx instance.
      Parameters:
      vertx - the vertx instance
      options - the Web Client options
      poolOptions - the HTTP Client pool options
      Returns:
      the created web client
    • create

      public static WebClient create(Vertx vertx, io.vertx.ext.web.client.WebClientConfig config)
      Create a web client using the provided vertx instance and default pooling options.
      Parameters:
      vertx - the vertx instance
      config - the Web Client config
      Returns:
      the created web client
    • create

      public static WebClient create(Vertx vertx, io.vertx.ext.web.client.WebClientConfig config, io.vertx.core.http.PoolOptions poolOptions)
      Create a web client using the provided vertx instance.
      Parameters:
      vertx - the vertx instance
      config - the Web Client config
      poolOptions - the HTTP Client pool options
      Returns:
      the created web client
    • create

      public static WebClient create(Vertx vertx, io.vertx.ext.web.client.WebClientConfig config, io.vertx.core.net.ClientSSLOptions sslOptions)
      Create a web client using the provided vertx instance, SSL options and default pooling options.
      Parameters:
      vertx - the vertx instance
      sslOptions - the SSL options
      config - the Web Client config
      Returns:
      the created web client
    • create

      public static WebClient create(Vertx vertx, io.vertx.ext.web.client.WebClientConfig config, io.vertx.core.net.ClientSSLOptions sslOptions, io.vertx.core.http.PoolOptions poolOptions)
      Create a web client using the provided vertx instance and SSL options.
      Parameters:
      vertx - the vertx instance
      config - the Web Client config
      sslOptions - the SSL options
      poolOptions - the HTTP Client pool 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 HttpClient to wrap
      Returns:
      the web client
    • wrap

      public static WebClient wrap(HttpClient httpClient, io.vertx.ext.web.client.WebClientOptions options)
      Wrap an httpClient with a web client and default options.

      Only the specific web client portion of the options is used, the io.vertx.mutiny.core.http.HttpClientOptions of the httpClient is reused.

      Parameters:
      httpClient - the HttpClient to wrap
      options - the Web Client options
      Returns:
      the web client
    • request

      public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.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 request URI
      Returns:
      an HTTP client request object
    • request

      public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, int port, String host, UriTemplate 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 request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • request

      public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, int port, String host, String requestURI)
      Like request(HttpMethod, int, String, 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 SocketAddress.domainSocketAddress(String) to connect to a unix domain socket server.

    • request

      public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, int port, String host, UriTemplate requestURI)
      Like request(HttpMethod, int, String, UriTemplate) 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 SocketAddress.domainSocketAddress(String) to connect to a unix domain socket server.

    • request

      public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.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 request URI
      Returns:
      an HTTP client request object
    • request

      public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, String host, UriTemplate 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 request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • request

      public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String host, String requestURI)
      Like request(HttpMethod, String, 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 SocketAddress.domainSocketAddress(String) to connect to a unix domain socket server.

    • request

      public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String host, UriTemplate requestURI)
      Like request(HttpMethod, String, UriTemplate) 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 SocketAddress.domainSocketAddress(String) to connect to a unix domain socket server.

    • request

      public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.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 request URI
      Returns:
      an HTTP client request object
    • request

      public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, UriTemplate requestURI)
      Create an HTTP request to send to the server at the default host and port.
      Parameters:
      method - the HTTP method
      requestURI - the request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • request

      public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String requestURI)
      Like request(HttpMethod, 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 SocketAddress.domainSocketAddress(String) to connect to a unix domain socket server.

    • request

      public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, UriTemplate requestURI)
      Like request(HttpMethod, UriTemplate) 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 SocketAddress.domainSocketAddress(String) to connect to a unix domain socket server.

    • request

      public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.RequestOptions options)
      Create an HTTP request to send to the server from the specified request options.
      Parameters:
      options - the request options
      Returns:
      an HTTP client request object
    • request

      @Deprecated public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.http.RequestOptions options)
      Deprecated.
      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

      @Deprecated public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, io.vertx.core.http.RequestOptions options)
      Deprecated.
      Like request(HttpMethod, RequestOptions) 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 SocketAddress.domainSocketAddress(String) to connect to a unix domain socket server.

    • requestAbs

      public HttpRequest<io.vertx.core.buffer.Buffer> requestAbs(io.vertx.core.http.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<io.vertx.core.buffer.Buffer> requestAbs(io.vertx.core.http.HttpMethod method, UriTemplate absoluteURI)
      Create an HTTP request to send to the server using an absolute URI
      Parameters:
      method - the HTTP method
      absoluteURI - the absolute URI as a UriTemplate
      Returns:
      an HTTP client request object
    • requestAbs

      public HttpRequest<io.vertx.core.buffer.Buffer> requestAbs(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String absoluteURI)
      Like requestAbs(HttpMethod, 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 SocketAddress.domainSocketAddress(String) to connect to a unix domain socket server.

    • requestAbs

      public HttpRequest<io.vertx.core.buffer.Buffer> requestAbs(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, UriTemplate absoluteURI)
      Like requestAbs(HttpMethod, UriTemplate) 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 SocketAddress.domainSocketAddress(String) to connect to a unix domain socket server.

    • get

      public HttpRequest<io.vertx.core.buffer.Buffer> get(String requestURI)
      Create an HTTP GET request to send to the server at the default host and port.
      Parameters:
      requestURI - the request URI
      Returns:
      an HTTP client request object
    • get

      public HttpRequest<io.vertx.core.buffer.Buffer> get(UriTemplate requestURI)
      Create an HTTP GET request to send to the server at the default host and port.
      Parameters:
      requestURI - the request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • get

      public HttpRequest<io.vertx.core.buffer.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 request URI
      Returns:
      an HTTP client request object
    • get

      public HttpRequest<io.vertx.core.buffer.Buffer> get(int port, String host, UriTemplate 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 request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • get

      public HttpRequest<io.vertx.core.buffer.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 request URI
      Returns:
      an HTTP client request object
    • get

      public HttpRequest<io.vertx.core.buffer.Buffer> get(String host, UriTemplate requestURI)
      Create an HTTP GET request to send to the server at the specified host and default port.
      Parameters:
      host - the host
      requestURI - the request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • getAbs

      public HttpRequest<io.vertx.core.buffer.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
    • getAbs

      public HttpRequest<io.vertx.core.buffer.Buffer> getAbs(UriTemplate 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 as a UriTemplate
      Returns:
      an HTTP client request object
    • post

      public HttpRequest<io.vertx.core.buffer.Buffer> post(String requestURI)
      Create an HTTP POST request to send to the server at the default host and port.
      Parameters:
      requestURI - the request URI
      Returns:
      an HTTP client request object
    • post

      public HttpRequest<io.vertx.core.buffer.Buffer> post(UriTemplate requestURI)
      Create an HTTP POST request to send to the server at the default host and port.
      Parameters:
      requestURI - the request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • post

      public HttpRequest<io.vertx.core.buffer.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 request URI
      Returns:
      an HTTP client request object
    • post

      public HttpRequest<io.vertx.core.buffer.Buffer> post(int port, String host, UriTemplate 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 request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • post

      public HttpRequest<io.vertx.core.buffer.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 request URI
      Returns:
      an HTTP client request object
    • post

      public HttpRequest<io.vertx.core.buffer.Buffer> post(String host, UriTemplate requestURI)
      Create an HTTP POST request to send to the server at the specified host and default port.
      Parameters:
      host - the host
      requestURI - the request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • postAbs

      public HttpRequest<io.vertx.core.buffer.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
    • postAbs

      public HttpRequest<io.vertx.core.buffer.Buffer> postAbs(UriTemplate 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 absoluate URI as a UriTemplate
      Returns:
      an HTTP client request object
    • put

      public HttpRequest<io.vertx.core.buffer.Buffer> put(String requestURI)
      Create an HTTP PUT request to send to the server at the default host and port.
      Parameters:
      requestURI - the request URI
      Returns:
      an HTTP client request object
    • put

      public HttpRequest<io.vertx.core.buffer.Buffer> put(UriTemplate requestURI)
      Create an HTTP PUT request to send to the server at the default host and port.
      Parameters:
      requestURI - the request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • put

      public HttpRequest<io.vertx.core.buffer.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 request URI
      Returns:
      an HTTP client request object
    • put

      public HttpRequest<io.vertx.core.buffer.Buffer> put(int port, String host, UriTemplate 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 request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • put

      public HttpRequest<io.vertx.core.buffer.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 request URI
      Returns:
      an HTTP client request object
    • put

      public HttpRequest<io.vertx.core.buffer.Buffer> put(String host, UriTemplate requestURI)
      Create an HTTP PUT request to send to the server at the specified host and default port.
      Parameters:
      host - the host
      requestURI - the request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • putAbs

      public HttpRequest<io.vertx.core.buffer.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
    • putAbs

      public HttpRequest<io.vertx.core.buffer.Buffer> putAbs(UriTemplate 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 as a UriTemplate
      Returns:
      an HTTP client request object
    • delete

      public HttpRequest<io.vertx.core.buffer.Buffer> delete(String requestURI)
      Create an HTTP DELETE request to send to the server at the default host and port.
      Parameters:
      requestURI - the request URI
      Returns:
      an HTTP client request object
    • delete

      public HttpRequest<io.vertx.core.buffer.Buffer> delete(UriTemplate requestURI)
      Create an HTTP DELETE request to send to the server at the default host and port.
      Parameters:
      requestURI - the request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • delete

      public HttpRequest<io.vertx.core.buffer.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 request URI
      Returns:
      an HTTP client request object
    • delete

      public HttpRequest<io.vertx.core.buffer.Buffer> delete(int port, String host, UriTemplate 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 request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • delete

      public HttpRequest<io.vertx.core.buffer.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 request URI
      Returns:
      an HTTP client request object
    • delete

      public HttpRequest<io.vertx.core.buffer.Buffer> delete(String host, UriTemplate requestURI)
      Create an HTTP DELETE request to send to the server at the specified host and default port.
      Parameters:
      host - the host
      requestURI - the request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • deleteAbs

      public HttpRequest<io.vertx.core.buffer.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
    • deleteAbs

      public HttpRequest<io.vertx.core.buffer.Buffer> deleteAbs(UriTemplate 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 as a UriTemplate
      Returns:
      an HTTP client request object
    • patch

      public HttpRequest<io.vertx.core.buffer.Buffer> patch(String requestURI)
      Create an HTTP PATCH request to send to the server at the default host and port.
      Parameters:
      requestURI - the request URI
      Returns:
      an HTTP client request object
    • patch

      public HttpRequest<io.vertx.core.buffer.Buffer> patch(UriTemplate requestURI)
      Create an HTTP PATCH request to send to the server at the default host and port.
      Parameters:
      requestURI - the request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • patch

      public HttpRequest<io.vertx.core.buffer.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 request URI
      Returns:
      an HTTP client request object
    • patch

      public HttpRequest<io.vertx.core.buffer.Buffer> patch(int port, String host, UriTemplate 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 request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • patch

      public HttpRequest<io.vertx.core.buffer.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 request URI
      Returns:
      an HTTP client request object
    • patch

      public HttpRequest<io.vertx.core.buffer.Buffer> patch(String host, UriTemplate requestURI)
      Create an HTTP PATCH request to send to the server at the specified host and default port.
      Parameters:
      host - the host
      requestURI - the request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • patchAbs

      public HttpRequest<io.vertx.core.buffer.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
    • patchAbs

      public HttpRequest<io.vertx.core.buffer.Buffer> patchAbs(UriTemplate 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 as a UriTemplate
      Returns:
      an HTTP client request object
    • head

      public HttpRequest<io.vertx.core.buffer.Buffer> head(String requestURI)
      Create an HTTP HEAD request to send to the server at the default host and port.
      Parameters:
      requestURI - the request URI
      Returns:
      an HTTP client request object
    • head

      public HttpRequest<io.vertx.core.buffer.Buffer> head(UriTemplate requestURI)
      Create an HTTP HEAD request to send to the server at the default host and port.
      Parameters:
      requestURI - the request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • head

      public HttpRequest<io.vertx.core.buffer.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 request URI
      Returns:
      an HTTP client request object
    • head

      public HttpRequest<io.vertx.core.buffer.Buffer> head(int port, String host, UriTemplate 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 request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • head

      public HttpRequest<io.vertx.core.buffer.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 request URI
      Returns:
      an HTTP client request object
    • head

      public HttpRequest<io.vertx.core.buffer.Buffer> head(String host, UriTemplate requestURI)
      Create an HTTP HEAD request to send to the server at the specified host and default port.
      Parameters:
      host - the host
      requestURI - the request URI as a UriTemplate
      Returns:
      an HTTP client request object
    • headAbs

      public HttpRequest<io.vertx.core.buffer.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
    • headAbs

      public HttpRequest<io.vertx.core.buffer.Buffer> headAbs(UriTemplate 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 as a UriTemplate
      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(io.vertx.ext.web.client.WebClient delegate)
      Creates a new instance of the WebClient.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object