Class WebClient

  • Direct Known Subclasses:
    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 Mutiny-ified interface using Vert.x codegen.

    • Constructor Detail

      • WebClient

        public WebClient​(io.vertx.ext.web.client.WebClient delegate)
      • WebClient

        public WebClient​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.ext.web.client.WebClient getDelegate()
      • hashCode

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

        public static WebClient create​(Vertx vertx)
        Parameters:
        vertx - the vertx instance
        Returns:
        the created web client
      • create

        public static WebClient create​(Vertx vertx,
                                       io.vertx.ext.web.client.WebClientOptions options)
        Parameters:
        vertx - the vertx instance
        options - the Web Client options
        Returns:
        the created web client
      • wrap

        public static WebClient wrap​(HttpClient httpClient)
        Parameters:
        httpClient - the to wrap
        Returns:
        the web client
      • wrap

        public static WebClient wrap​(HttpClient httpClient,
                                     io.vertx.ext.web.client.WebClientOptions options)
        Parameters:
        httpClient - the to wrap
        options - the Web Client options
        Returns:
        the web client
      • request

        public HttpRequest<Buffer> request​(io.vertx.core.http.HttpMethod method,
                                           int port,
                                           String host,
                                           String requestURI)
        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​(io.vertx.core.http.HttpMethod method,
                                           SocketAddress serverAddress,
                                           int port,
                                           String host,
                                           String requestURI)
        Parameters:
        method -
        serverAddress -
        port -
        host -
        requestURI -
        Returns:
      • request

        public HttpRequest<Buffer> request​(io.vertx.core.http.HttpMethod method,
                                           String host,
                                           String requestURI)
        Parameters:
        method - the HTTP method
        host - the host
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • request

        public HttpRequest<Buffer> request​(io.vertx.core.http.HttpMethod method,
                                           SocketAddress serverAddress,
                                           String host,
                                           String requestURI)
        Parameters:
        method -
        serverAddress -
        host -
        requestURI -
        Returns:
      • request

        public HttpRequest<Buffer> request​(io.vertx.core.http.HttpMethod method,
                                           String requestURI)
        Parameters:
        method - the HTTP method
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • request

        public HttpRequest<Buffer> request​(io.vertx.core.http.HttpMethod method,
                                           SocketAddress serverAddress,
                                           String requestURI)
        Parameters:
        method -
        serverAddress -
        requestURI -
        Returns:
      • request

        public HttpRequest<Buffer> request​(io.vertx.core.http.HttpMethod method,
                                           io.vertx.core.http.RequestOptions options)
        Parameters:
        method - the HTTP method
        options - the request options
        Returns:
        an HTTP client request object
      • request

        public HttpRequest<Buffer> request​(io.vertx.core.http.HttpMethod method,
                                           SocketAddress serverAddress,
                                           io.vertx.core.http.RequestOptions options)
        Parameters:
        method -
        serverAddress -
        options -
        Returns:
      • requestAbs

        public HttpRequest<Buffer> requestAbs​(io.vertx.core.http.HttpMethod method,
                                              String absoluteURI)
        Parameters:
        method - the HTTP method
        absoluteURI - the absolute URI
        Returns:
        an HTTP client request object
      • requestAbs

        public HttpRequest<Buffer> requestAbs​(io.vertx.core.http.HttpMethod method,
                                              SocketAddress serverAddress,
                                              String absoluteURI)
        Parameters:
        method -
        serverAddress -
        absoluteURI -
        Returns:
      • get

        public HttpRequest<Buffer> get​(String requestURI)
        Parameters:
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • get

        public HttpRequest<Buffer> get​(int port,
                                       String host,
                                       String requestURI)
        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)
        Parameters:
        host - the host
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • getAbs

        public HttpRequest<Buffer> getAbs​(String absoluteURI)
        Parameters:
        absoluteURI - the absolute URI
        Returns:
        an HTTP client request object
      • post

        public HttpRequest<Buffer> post​(String requestURI)
        Parameters:
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • post

        public HttpRequest<Buffer> post​(int port,
                                        String host,
                                        String requestURI)
        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)
        Parameters:
        host - the host
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • postAbs

        public HttpRequest<Buffer> postAbs​(String absoluteURI)
        Parameters:
        absoluteURI - the absolute URI
        Returns:
        an HTTP client request object
      • put

        public HttpRequest<Buffer> put​(String requestURI)
        Parameters:
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • put

        public HttpRequest<Buffer> put​(int port,
                                       String host,
                                       String requestURI)
        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)
        Parameters:
        host - the host
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • putAbs

        public HttpRequest<Buffer> putAbs​(String absoluteURI)
        Parameters:
        absoluteURI - the absolute URI
        Returns:
        an HTTP client request object
      • delete

        public HttpRequest<Buffer> delete​(String requestURI)
        Parameters:
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • delete

        public HttpRequest<Buffer> delete​(int port,
                                          String host,
                                          String requestURI)
        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)
        Parameters:
        host - the host
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • deleteAbs

        public HttpRequest<Buffer> deleteAbs​(String absoluteURI)
        Parameters:
        absoluteURI - the absolute URI
        Returns:
        an HTTP client request object
      • patch

        public HttpRequest<Buffer> patch​(String requestURI)
        Parameters:
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • patch

        public HttpRequest<Buffer> patch​(int port,
                                         String host,
                                         String requestURI)
        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)
        Parameters:
        host - the host
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • patchAbs

        public HttpRequest<Buffer> patchAbs​(String absoluteURI)
        Parameters:
        absoluteURI - the absolute URI
        Returns:
        an HTTP client request object
      • head

        public HttpRequest<Buffer> head​(String requestURI)
        Parameters:
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • head

        public HttpRequest<Buffer> head​(int port,
                                        String host,
                                        String requestURI)
        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)
        Parameters:
        host - the host
        requestURI - the relative URI
        Returns:
        an HTTP client request object
      • headAbs

        public HttpRequest<Buffer> headAbs​(String absoluteURI)
        Parameters:
        absoluteURI - the absolute URI
        Returns:
        an HTTP client request object
      • close

        public void close()
      • newInstance

        public static WebClient newInstance​(io.vertx.ext.web.client.WebClient arg)