Interface WebClient
-
- All Known Subinterfaces:
OAuth2WebClient
,WebClientSession
public interface WebClient
An asynchronous HTTP / HTTP/2 client calledWebClient
.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. TheHttpClient
should be used when fine grained control over the HTTP requests/response is necessary.- Author:
- Julien Viet
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description WebClient
addInterceptor(Handler<io.vertx.ext.web.client.impl.HttpContext<?>> interceptor)
Add interceptor in the chain.void
close()
Close the client.static WebClient
create(Vertx vertx)
Create a web client using the providedvertx
instance and default options.static WebClient
create(Vertx vertx, WebClientOptions options)
Create a web client using the providedvertx
instance and default pooling options.static WebClient
create(Vertx vertx, WebClientOptions options, PoolOptions poolOptions)
Create a web client using the providedvertx
instance.default HttpRequest<Buffer>
delete(int port, String host, UriTemplate requestURI)
Create an HTTP DELETE request to send to the server at the specified host and port.default 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.default HttpRequest<Buffer>
delete(UriTemplate requestURI)
Create an HTTP DELETE request to send to the server at the default host and port.default HttpRequest<Buffer>
delete(String requestURI)
Create an HTTP DELETE request to send to the server at the default host and port.default HttpRequest<Buffer>
delete(String host, UriTemplate requestURI)
Create an HTTP DELETE request to send to the server at the specified host and default port.default HttpRequest<Buffer>
delete(String host, String requestURI)
Create an HTTP DELETE request to send to the server at the specified host and default port.default HttpRequest<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 responsedefault 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 responsedefault HttpRequest<Buffer>
get(int port, String host, UriTemplate requestURI)
Create an HTTP GET request to send to the server at the specified host and port.default 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.default HttpRequest<Buffer>
get(UriTemplate requestURI)
Create an HTTP GET request to send to the server at the default host and port.default HttpRequest<Buffer>
get(String requestURI)
Create an HTTP GET request to send to the server at the default host and port.default HttpRequest<Buffer>
get(String host, UriTemplate requestURI)
Create an HTTP GET request to send to the server at the specified host and default port.default HttpRequest<Buffer>
get(String host, String requestURI)
Create an HTTP GET request to send to the server at the specified host and default port.default HttpRequest<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 responsedefault 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 responsedefault HttpRequest<Buffer>
head(int port, String host, UriTemplate requestURI)
Create an HTTP HEAD request to send to the server at the specified host and port.default 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.default HttpRequest<Buffer>
head(UriTemplate requestURI)
Create an HTTP HEAD request to send to the server at the default host and port.default HttpRequest<Buffer>
head(String requestURI)
Create an HTTP HEAD request to send to the server at the default host and port.default HttpRequest<Buffer>
head(String host, UriTemplate requestURI)
Create an HTTP HEAD request to send to the server at the specified host and default port.default HttpRequest<Buffer>
head(String host, String requestURI)
Create an HTTP HEAD request to send to the server at the specified host and default port.default HttpRequest<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 responsedefault 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 responsedefault HttpRequest<Buffer>
patch(int port, String host, UriTemplate requestURI)
Create an HTTP PATCH request to send to the server at the specified host and port.default 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.default HttpRequest<Buffer>
patch(UriTemplate requestURI)
Create an HTTP PATCH request to send to the server at the default host and port.default HttpRequest<Buffer>
patch(String requestURI)
Create an HTTP PATCH request to send to the server at the default host and port.default HttpRequest<Buffer>
patch(String host, UriTemplate requestURI)
Create an HTTP PATCH request to send to the server at the specified host and default port.default HttpRequest<Buffer>
patch(String host, String requestURI)
Create an HTTP PATCH request to send to the server at the specified host and default port.default HttpRequest<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 responsedefault 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 responsedefault HttpRequest<Buffer>
post(int port, String host, UriTemplate requestURI)
Create an HTTP POST request to send to the server at the specified host and port.default 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.default HttpRequest<Buffer>
post(UriTemplate requestURI)
Create an HTTP POST request to send to the server at the default host and port.default HttpRequest<Buffer>
post(String requestURI)
Create an HTTP POST request to send to the server at the default host and port.default HttpRequest<Buffer>
post(String host, UriTemplate requestURI)
Create an HTTP POST request to send to the server at the specified host and default port.default HttpRequest<Buffer>
post(String host, String requestURI)
Create an HTTP POST request to send to the server at the specified host and default port.default HttpRequest<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 responsedefault 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 responsedefault HttpRequest<Buffer>
put(int port, String host, UriTemplate requestURI)
Create an HTTP PUT request to send to the server at the specified host and port.default 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.default HttpRequest<Buffer>
put(UriTemplate requestURI)
Create an HTTP PUT request to send to the server at the default host and port.default HttpRequest<Buffer>
put(String requestURI)
Create an HTTP PUT request to send to the server at the default host and port.default HttpRequest<Buffer>
put(String host, UriTemplate requestURI)
Create an HTTP PUT request to send to the server at the specified host and default port.default HttpRequest<Buffer>
put(String host, String requestURI)
Create an HTTP PUT request to send to the server at the specified host and default port.default HttpRequest<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 responsedefault 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 responsedefault HttpRequest<Buffer>
request(HttpMethod method, int port, String host, UriTemplate requestURI)
Create an HTTP request to send to the server at the specified host and port.default 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.default 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, UriTemplate requestURI)
Likerequest(HttpMethod, int, String, UriTemplate)
using theserverAddress
parameter to connect to the server instead of theport
andhost
parameters.HttpRequest<Buffer>
request(HttpMethod method, SocketAddress serverAddress, int port, String host, String requestURI)
Likerequest(HttpMethod, int, String, String)
using theserverAddress
parameter to connect to the server instead of theport
andhost
parameters.HttpRequest<Buffer>
request(HttpMethod method, SocketAddress serverAddress, RequestOptions options)
Likerequest(HttpMethod, RequestOptions)
using theserverAddress
parameter to connect to the server instead of theoptions
parameter.HttpRequest<Buffer>
request(HttpMethod method, SocketAddress serverAddress, UriTemplate requestURI)
Likerequest(HttpMethod, UriTemplate)
using theserverAddress
parameter to connect to the server instead of the default port and default host.HttpRequest<Buffer>
request(HttpMethod method, SocketAddress serverAddress, String requestURI)
Likerequest(HttpMethod, String)
using theserverAddress
parameter to connect to the server instead of the default port and default host.HttpRequest<Buffer>
request(HttpMethod method, SocketAddress serverAddress, String host, UriTemplate requestURI)
Likerequest(HttpMethod, String, UriTemplate)
using theserverAddress
parameter to connect to the server instead of the default port andhost
parameter.HttpRequest<Buffer>
request(HttpMethod method, SocketAddress serverAddress, String host, String requestURI)
Likerequest(HttpMethod, String, String)
using theserverAddress
parameter to connect to the server instead of the default port andhost
parameter.default HttpRequest<Buffer>
request(HttpMethod method, UriTemplate requestURI)
Create an HTTP request to send to the server at the default host and port.default HttpRequest<Buffer>
request(HttpMethod method, String requestURI)
Create an HTTP request to send to the server at the default host and port.default HttpRequest<Buffer>
request(HttpMethod method, String host, UriTemplate requestURI)
Create an HTTP request to send to the server at the specified host and default port.default 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, UriTemplate absoluteURI)
LikerequestAbs(HttpMethod, UriTemplate)
using theserverAddress
parameter to connect to the server instead of theabsoluteURI
parameter.HttpRequest<Buffer>
requestAbs(HttpMethod method, SocketAddress serverAddress, String absoluteURI)
LikerequestAbs(HttpMethod, String)
using theserverAddress
parameter to connect to the server instead of theabsoluteURI
parameter.default HttpRequest<Buffer>
requestAbs(HttpMethod method, UriTemplate absoluteURI)
Create an HTTP request to send to the server using an absolute URIdefault HttpRequest<Buffer>
requestAbs(HttpMethod method, String absoluteURI)
Create an HTTP request to send to the server using an absolute URIdefault Future<Boolean>
updateSSLOptions(ClientSSLOptions options)
Update the client with new SSLoptions
, the update happens if the options object is valid and different from the existing options object.Future<Boolean>
updateSSLOptions(ClientSSLOptions options, boolean force)
Update the client with new SSLoptions
, the update happens if the options object is valid and different from the existing options object.static WebClient
wrap(HttpClient httpClient)
Wrap anhttpClient
with a web client and default options.static WebClient
wrap(HttpClient httpClient, WebClientOptions options)
Wrap anhttpClient
with a web client and default options.
-
-
-
Method Detail
-
create
static WebClient create(Vertx vertx)
Create a web client using the providedvertx
instance and default options.- Parameters:
vertx
- the vertx instance- Returns:
- the created web client
-
create
static WebClient create(Vertx vertx, WebClientOptions options)
Create a web client using the providedvertx
instance and default pooling options.- Parameters:
vertx
- the vertx instanceoptions
- the Web Client options- Returns:
- the created web client
-
create
static WebClient create(Vertx vertx, WebClientOptions options, PoolOptions poolOptions)
Create a web client using the providedvertx
instance.- Parameters:
vertx
- the vertx instanceoptions
- the Web Client optionspoolOptions
- the HTTP Client pool options- Returns:
- the created web client
-
wrap
static WebClient wrap(HttpClient httpClient)
Wrap anhttpClient
with a web client and default options.- Parameters:
httpClient
- theHttpClient
to wrap- Returns:
- the web client
-
wrap
static WebClient wrap(HttpClient httpClient, WebClientOptions options)
Wrap anhttpClient
with a web client and default options.Only the specific web client portion of the
options
is used, theHttpClientOptions
of thehttpClient
is reused.- Parameters:
httpClient
- theHttpClient
to wrapoptions
- the Web Client options- Returns:
- the web client
-
request
default 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 methodport
- the porthost
- the hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
request
default HttpRequest<Buffer> request(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 methodport
- the porthost
- the hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
request
HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, int port, String host, String requestURI)
Likerequest(HttpMethod, int, String, String)
using theserverAddress
parameter to connect to the server instead of theport
andhost
parameters.The request host header will still be created from the
port
andhost
parameters.Use
SocketAddress.domainSocketAddress(String)
to connect to a unix domain socket server.
-
request
HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, int port, String host, UriTemplate requestURI)
Likerequest(HttpMethod, int, String, UriTemplate)
using theserverAddress
parameter to connect to the server instead of theport
andhost
parameters.The request host header will still be created from the
port
andhost
parameters.Use
SocketAddress.domainSocketAddress(String)
to connect to a unix domain socket server.
-
request
default 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 methodhost
- the hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
request
default HttpRequest<Buffer> request(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 methodhost
- the hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
request
HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, String host, String requestURI)
Likerequest(HttpMethod, String, String)
using theserverAddress
parameter to connect to the server instead of the default port andhost
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
HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, String host, UriTemplate requestURI)
Likerequest(HttpMethod, String, UriTemplate)
using theserverAddress
parameter to connect to the server instead of the default port andhost
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
default 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 methodrequestURI
- the request URI- Returns:
- an HTTP client request object
-
request
default HttpRequest<Buffer> request(HttpMethod method, UriTemplate requestURI)
Create an HTTP request to send to the server at the default host and port.- Parameters:
method
- the HTTP methodrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
request
HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, String requestURI)
Likerequest(HttpMethod, String)
using theserverAddress
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
HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, UriTemplate requestURI)
Likerequest(HttpMethod, UriTemplate)
using theserverAddress
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
default 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 methodoptions
- the request options- Returns:
- an HTTP client request object
-
request
HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, RequestOptions options)
Likerequest(HttpMethod, RequestOptions)
using theserverAddress
parameter to connect to the server instead of theoptions
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
default HttpRequest<Buffer> requestAbs(HttpMethod method, String absoluteURI)
Create an HTTP request to send to the server using an absolute URI- Parameters:
method
- the HTTP methodabsoluteURI
- the absolute URI- Returns:
- an HTTP client request object
-
requestAbs
default HttpRequest<Buffer> requestAbs(HttpMethod method, UriTemplate absoluteURI)
Create an HTTP request to send to the server using an absolute URI- Parameters:
method
- the HTTP methodabsoluteURI
- the absolute URI as aUriTemplate
- Returns:
- an HTTP client request object
-
requestAbs
HttpRequest<Buffer> requestAbs(HttpMethod method, SocketAddress serverAddress, String absoluteURI)
LikerequestAbs(HttpMethod, String)
using theserverAddress
parameter to connect to the server instead of theabsoluteURI
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
HttpRequest<Buffer> requestAbs(HttpMethod method, SocketAddress serverAddress, UriTemplate absoluteURI)
LikerequestAbs(HttpMethod, UriTemplate)
using theserverAddress
parameter to connect to the server instead of theabsoluteURI
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
default HttpRequest<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
default HttpRequest<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 aUriTemplate
- Returns:
- an HTTP client request object
-
get
default 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 porthost
- the hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
get
default HttpRequest<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 porthost
- the hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
get
default 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 hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
get
default HttpRequest<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 hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
getAbs
default 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
-
getAbs
default HttpRequest<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 aUriTemplate
- Returns:
- an HTTP client request object
-
post
default HttpRequest<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
default HttpRequest<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 aUriTemplate
- Returns:
- an HTTP client request object
-
post
default 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 porthost
- the hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
post
default HttpRequest<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 porthost
- the hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
post
default 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 hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
post
default HttpRequest<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 hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
postAbs
default 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
-
postAbs
default HttpRequest<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 aUriTemplate
- Returns:
- an HTTP client request object
-
put
default HttpRequest<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
default HttpRequest<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 aUriTemplate
- Returns:
- an HTTP client request object
-
put
default 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 porthost
- the hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
put
default HttpRequest<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 porthost
- the hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
put
default 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 hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
put
default HttpRequest<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 hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
putAbs
default 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
-
putAbs
default HttpRequest<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 aUriTemplate
- Returns:
- an HTTP client request object
-
delete
default HttpRequest<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
default HttpRequest<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 aUriTemplate
- Returns:
- an HTTP client request object
-
delete
default 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 porthost
- the hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
delete
default HttpRequest<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 porthost
- the hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
delete
default 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 hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
delete
default HttpRequest<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 hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
deleteAbs
default 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
-
deleteAbs
default HttpRequest<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 aUriTemplate
- Returns:
- an HTTP client request object
-
patch
default HttpRequest<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
default HttpRequest<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 aUriTemplate
- Returns:
- an HTTP client request object
-
patch
default 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 porthost
- the hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
patch
default HttpRequest<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 porthost
- the hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
patch
default 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 hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
patch
default HttpRequest<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 hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
patchAbs
default 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
-
patchAbs
default HttpRequest<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 aUriTemplate
- Returns:
- an HTTP client request object
-
head
default HttpRequest<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
default HttpRequest<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 aUriTemplate
- Returns:
- an HTTP client request object
-
head
default 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 porthost
- the hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
head
default HttpRequest<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 porthost
- the hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
head
default 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 hostrequestURI
- the request URI- Returns:
- an HTTP client request object
-
head
default HttpRequest<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 hostrequestURI
- the request URI as aUriTemplate
- Returns:
- an HTTP client request object
-
headAbs
default 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
-
headAbs
default HttpRequest<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 aUriTemplate
- Returns:
- an HTTP client request object
-
addInterceptor
WebClient addInterceptor(Handler<io.vertx.ext.web.client.impl.HttpContext<?>> interceptor)
Add interceptor in the chain. The interceptor can maintain per request state withHttpContext.get(String)
/HttpContext.set(String, Object)
. A request/response can be processed several times (in case of retry) and thus they should use the per request state to ensure an operation is not done twice. This API is internal.- Parameters:
interceptor
- the interceptor to add, must not be null- Returns:
- a reference to this, so the API can be used fluently
-
updateSSLOptions
default Future<Boolean> updateSSLOptions(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 future result indicates whether the update occurred.
- Parameters:
options
- the new SSL options- Returns:
- a future signaling the update success
-
updateSSLOptions
Future<Boolean> updateSSLOptions(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 itsequals
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, settingforce
totrue
forces the update.The boolean succeeded future result indicates whether the update occurred.
- Parameters:
options
- the new SSL optionsforce
- force the update when options are equals- Returns:
- a future signaling the update success
-
close
void close()
Close the client. Closing will close down any pooled connections. Clients should always be closed after use.
-
-