vertx-lang-scala-docs_2.12 3.9.1 API < Back
 

# Packages

-  package root
  Definition Classes
    root
-  package io
  Definition Classes
    root
-  package vertx
  Definition Classes
    io
-  package scala
  Definition Classes
    vertx
-  package ext
  Definition Classes
    scala
-  package web
  Definition Classes
    ext
-  package client
  Definition Classes
    web
-  package predicate
  Definition Classes
    client
- HttpRequest
- HttpResponse
- WebClient
- WebClientOptions

c

io.vertx.scala.ext.web.client

# WebClient 

###
Companion object WebClient

#### class WebClient extends AnyRef

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.

Linear Supertypes
AnyRef, Any
 
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. WebClient
2. AnyRef
3. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Instance Constructors

1.  new WebClient(_asJava: AnyRef)

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##(): Int
   Definition Classes
     AnyRef → Any
3.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
4.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
5.  def asJava: AnyRef
6.  def clone(): AnyRef
   Attributes
     protected[java.lang]
   Definition Classes
     AnyRef
   Annotations
     @native() @throws( ... )
7.  def close(): Unit

   Close the client.

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

8.  def delete(host: String, requestURI: String): HttpRequest[Buffer]

   Create an HTTP DELETE request to send to the server at the specified host and default port.

   Create an HTTP DELETE request to send to the server at the specified host and default port. * @param host the host

   requestURI

     the relative URI

   returns

     an HTTP client request object

9.  def delete(port: Int, host: String, requestURI: String): HttpRequest[Buffer]

   Create an HTTP DELETE request to send to the server at the specified host and port.

   Create an HTTP DELETE request to send to the server at the specified host and port. * @param port the port

   host

     the host

   requestURI

     the relative URI

   returns

     an HTTP client request object

10.  def delete(requestURI: String): HttpRequest[Buffer]

    Create an HTTP DELETE request to send to the server at the default host and port.

    Create an HTTP DELETE request to send to the server at the default host and port. * @param requestURI the relative URI

    returns

      an HTTP client request object

11.  def deleteAbs(absoluteURI: String): HttpRequest[Buffer]

    Create an HTTP DELETE request to send to the server using an absolute URI, specifying a response handler to receive the response * @param absoluteURI the absolute URI

    Create an HTTP DELETE request to send to the server using an absolute URI, specifying a response handler to receive the response * @param absoluteURI the absolute URI

    returns

      an HTTP client request object

12.  final def eq(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
13.  def equals(arg0: Any): Boolean
    Definition Classes
      AnyRef → Any
14.  def finalize(): Unit
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )
15.  def get(host: String, requestURI: String): HttpRequest[Buffer]

    Create an HTTP GET request to send to the server at the specified host and default port.

    Create an HTTP GET request to send to the server at the specified host and default port. * @param host the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

16.  def get(port: Int, host: String, requestURI: String): HttpRequest[Buffer]

    Create an HTTP GET request to send to the server at the specified host and port.

    Create an HTTP GET request to send to the server at the specified host and port. * @param port the port

    host

      the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

17.  def get(requestURI: String): HttpRequest[Buffer]

    Create an HTTP GET request to send to the server at the default host and port.

    Create an HTTP GET request to send to the server at the default host and port. * @param requestURI the relative URI

    returns

      an HTTP client request object

18.  def getAbs(absoluteURI: String): HttpRequest[Buffer]

    Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive the response * @param absoluteURI the absolute URI

    Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive the response * @param absoluteURI the absolute URI

    returns

      an HTTP client request object

19.  final def getClass(): Class[_]
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
20.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
21.  def head(host: String, requestURI: String): HttpRequest[Buffer]

    Create an HTTP HEAD request to send to the server at the specified host and default port.

    Create an HTTP HEAD request to send to the server at the specified host and default port. * @param host the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

22.  def head(port: Int, host: String, requestURI: String): HttpRequest[Buffer]

    Create an HTTP HEAD request to send to the server at the specified host and port.

    Create an HTTP HEAD request to send to the server at the specified host and port. * @param port the port

    host

      the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

23.  def head(requestURI: String): HttpRequest[Buffer]

    Create an HTTP HEAD request to send to the server at the default host and port.

    Create an HTTP HEAD request to send to the server at the default host and port. * @param requestURI the relative URI

    returns

      an HTTP client request object

24.  def headAbs(absoluteURI: String): HttpRequest[Buffer]

    Create an HTTP HEAD request to send to the server using an absolute URI, specifying a response handler to receive the response * @param absoluteURI the absolute URI

    Create an HTTP HEAD request to send to the server using an absolute URI, specifying a response handler to receive the response * @param absoluteURI the absolute URI

    returns

      an HTTP client request object

25.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
26.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
27.  final def notify(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
28.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
29.  def patch(host: String, requestURI: String): HttpRequest[Buffer]

    Create an HTTP PATCH request to send to the server at the specified host and default port.

    Create an HTTP PATCH request to send to the server at the specified host and default port. * @param host the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

30.  def patch(port: Int, host: String, requestURI: String): HttpRequest[Buffer]

    Create an HTTP PATCH request to send to the server at the specified host and port.

    Create an HTTP PATCH request to send to the server at the specified host and port. * @param port the port

    host

      the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

31.  def patch(requestURI: String): HttpRequest[Buffer]

    Create an HTTP PATCH request to send to the server at the default host and port.

    Create an HTTP PATCH request to send to the server at the default host and port. * @param requestURI the relative URI

    returns

      an HTTP client request object

32.  def patchAbs(absoluteURI: String): HttpRequest[Buffer]

    Create an HTTP PATCH request to send to the server using an absolute URI, specifying a response handler to receive the response * @param absoluteURI the absolute URI

    Create an HTTP PATCH request to send to the server using an absolute URI, specifying a response handler to receive the response * @param absoluteURI the absolute URI

    returns

      an HTTP client request object

33.  def post(host: String, requestURI: String): HttpRequest[Buffer]

    Create an HTTP POST request to send to the server at the specified host and default port.

    Create an HTTP POST request to send to the server at the specified host and default port. * @param host the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

34.  def post(port: Int, host: String, requestURI: String): HttpRequest[Buffer]

    Create an HTTP POST request to send to the server at the specified host and port.

    Create an HTTP POST request to send to the server at the specified host and port. * @param port the port

    host

      the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

35.  def post(requestURI: String): HttpRequest[Buffer]

    Create an HTTP POST request to send to the server at the default host and port.

    Create an HTTP POST request to send to the server at the default host and port. * @param requestURI the relative URI

    returns

      an HTTP client request object

36.  def postAbs(absoluteURI: String): HttpRequest[Buffer]

    Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive the response * @param absoluteURI the absolute URI

    Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive the response * @param absoluteURI the absolute URI

    returns

      an HTTP client request object

37.  def put(host: String, requestURI: String): HttpRequest[Buffer]

    Create an HTTP PUT request to send to the server at the specified host and default port.

    Create an HTTP PUT request to send to the server at the specified host and default port. * @param host the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

38.  def put(port: Int, host: String, requestURI: String): HttpRequest[Buffer]

    Create an HTTP PUT request to send to the server at the specified host and port.

    Create an HTTP PUT request to send to the server at the specified host and port. * @param port the port

    host

      the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

39.  def put(requestURI: String): HttpRequest[Buffer]

    Create an HTTP PUT request to send to the server at the default host and port.

    Create an HTTP PUT request to send to the server at the default host and port. * @param requestURI the relative URI

    returns

      an HTTP client request object

40.  def putAbs(absoluteURI: String): HttpRequest[Buffer]

    Create an HTTP PUT request to send to the server using an absolute URI, specifying a response handler to receive the response * @param absoluteURI the absolute URI

    Create an HTTP PUT request to send to the server using an absolute URI, specifying a response handler to receive the response * @param absoluteURI the absolute URI

    returns

      an HTTP client request object

41.  def raw(customHttpMethod: String, host: String, requestURI: String): HttpRequest[Buffer]

    Create a request with a custom HTTP method to send to the server at the specified host and default port.

    Create a request with a custom HTTP method to send to the server at the specified host and default port. * @param customHttpMethod custom HTTP Method

    host

      the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

42.  def raw(customHttpMethod: String, port: Int, host: String, requestURI: String): HttpRequest[Buffer]

    Create a request with a custom HTTP method to send to the server at the specified host and port.

    Create a request with a custom HTTP method to send to the server at the specified host and port. * @param customHttpMethod custom HTTP Method

    port

      the port

    host

      the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

43.  def raw(customHttpMethod: String, requestURI: String): HttpRequest[Buffer]

    Create a request with a custom HTTP method to send to the server at the default host and port.

    Create a request with a custom HTTP method to send to the server at the default host and port. * @param customHttpMethod custom HTTP Method

    requestURI

      the relative URI

    returns

      an HTTP client request object

44.  def rawAbs(customHttpMethod: String, absoluteURI: String): HttpRequest[Buffer]

    Create a request with a custom HTTP method to send to the server using an absolute URI, specifying a response handler to receive the response * @param customHttpMethod custom HTTP Method

    Create a request with a custom HTTP method to send to the server using an absolute URI, specifying a response handler to receive the response * @param customHttpMethod custom HTTP Method

    absoluteURI

      the absolute URI

    returns

      an HTTP client request object

45.  def request(method: HttpMethod, serverAddress: SocketAddress, options: RequestOptions): HttpRequest[Buffer]

    Like io.vertx.scala.ext.web.client.WebClient#request using the `serverAddress` parameter to connect to the server instead of the `options` parameter.

    Like io.vertx.scala.ext.web.client.WebClient#request 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.

46.  def request(method: HttpMethod, options: RequestOptions): HttpRequest[Buffer]

    Create an HTTP request to send to the server at the specified host and port.

    Create an HTTP request to send to the server at the specified host and port. * @param method the HTTP method

    options

      the request options see RequestOptions

    returns

      an HTTP client request object

47.  def request(method: HttpMethod, serverAddress: SocketAddress, requestURI: String): HttpRequest[Buffer]

    Like io.vertx.scala.ext.web.client.WebClient#request using the `serverAddress` parameter to connect to the server instead of the default port and default host.

    Like io.vertx.scala.ext.web.client.WebClient#request 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.

48.  def request(method: HttpMethod, requestURI: String): HttpRequest[Buffer]

    Create an HTTP request to send to the server at the default host and port.

    Create an HTTP request to send to the server at the default host and port. * @param method the HTTP method

    requestURI

      the relative URI

    returns

      an HTTP client request object

49.  def request(method: HttpMethod, serverAddress: SocketAddress, host: String, requestURI: String): HttpRequest[Buffer]

    Like io.vertx.scala.ext.web.client.WebClient#request using the `serverAddress` parameter to connect to the server instead of the default port and `host` parameter.

    Like io.vertx.scala.ext.web.client.WebClient#request 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.

50.  def request(method: HttpMethod, host: String, requestURI: String): HttpRequest[Buffer]

    Create an HTTP request to send to the server at the specified host and default port.

    Create an HTTP request to send to the server at the specified host and default port. * @param method the HTTP method

    host

      the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

51.  def request(method: HttpMethod, serverAddress: SocketAddress, port: Int, host: String, requestURI: String): HttpRequest[Buffer]

    Like io.vertx.scala.ext.web.client.WebClient#request using the `serverAddress` parameter to connect to the server instead of the `port` and `host` parameters.

    Like io.vertx.scala.ext.web.client.WebClient#request 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.

52.  def request(method: HttpMethod, port: Int, host: String, requestURI: String): HttpRequest[Buffer]

    Create an HTTP request to send to the server at the specified host and port.

    Create an HTTP request to send to the server at the specified host and port. * @param method the HTTP method

    port

      the port

    host

      the host

    requestURI

      the relative URI

    returns

      an HTTP client request object

53.  def requestAbs(method: HttpMethod, serverAddress: SocketAddress, absoluteURI: String): HttpRequest[Buffer]

    Like io.vertx.scala.ext.web.client.WebClient#requestAbs using the `serverAddress` parameter to connect to the server instead of the `absoluteURI` parameter.

    Like io.vertx.scala.ext.web.client.WebClient#requestAbs 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.

54.  def requestAbs(method: HttpMethod, absoluteURI: String): HttpRequest[Buffer]

    Create an HTTP request to send to the server using an absolute URI * @param method the HTTP method

    Create an HTTP request to send to the server using an absolute URI * @param method the HTTP method

    absoluteURI

      the absolute URI

    returns

      an HTTP client request object

55.  final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
      AnyRef
56.  def toString(): String
    Definition Classes
      AnyRef → Any
57.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
58.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
59.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @native() @throws( ... )

### Inherited from AnyRef

### Inherited from Any

### Ungrouped