public class WebClient extends Object
WebClient
.
The web client makes easy to do HTTP request/response interactions with a web server, and provides advanced features like:
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.
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<WebClient> |
__TYPE_ARG |
Constructor and Description |
---|
WebClient(Object delegate) |
WebClient(WebClient delegate) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the client.
|
static WebClient |
create(Vertx vertx)
Create a web client using the provided
vertx instance and default options. |
static WebClient |
create(Vertx vertx,
WebClientOptions options)
Create a web client using the provided
vertx instance. |
HttpRequest<Buffer> |
delete(int port,
String host,
String requestURI)
Create an HTTP DELETE request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
delete(int port,
String host,
UriTemplate requestURI)
Create an HTTP DELETE request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
delete(String requestURI)
Create an HTTP DELETE request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
delete(String host,
String requestURI)
Create an HTTP DELETE request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
delete(String host,
UriTemplate requestURI)
Create an HTTP DELETE request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
delete(UriTemplate requestURI)
Create an HTTP DELETE request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
deleteAbs(String absoluteURI)
Create an HTTP DELETE request to send to the server using an absolute URI, specifying a response handler to receive
the response
|
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
|
boolean |
equals(Object o) |
HttpRequest<Buffer> |
get(int port,
String host,
String requestURI)
Create an HTTP GET request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
get(int port,
String host,
UriTemplate requestURI)
Create an HTTP GET request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
get(String requestURI)
Create an HTTP GET request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
get(String host,
String requestURI)
Create an HTTP GET request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
get(String host,
UriTemplate requestURI)
Create an HTTP GET request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
get(UriTemplate requestURI)
Create an HTTP GET request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
getAbs(String absoluteURI)
Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive
the response
|
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
|
WebClient |
getDelegate() |
int |
hashCode() |
HttpRequest<Buffer> |
head(int port,
String host,
String requestURI)
Create an HTTP HEAD request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
head(int port,
String host,
UriTemplate requestURI)
Create an HTTP HEAD request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
head(String requestURI)
Create an HTTP HEAD request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
head(String host,
String requestURI)
Create an HTTP HEAD request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
head(String host,
UriTemplate requestURI)
Create an HTTP HEAD request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
head(UriTemplate requestURI)
Create an HTTP HEAD request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
headAbs(String absoluteURI)
Create an HTTP HEAD request to send to the server using an absolute URI, specifying a response handler to receive
the response
|
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
|
static WebClient |
newInstance(WebClient arg) |
HttpRequest<Buffer> |
patch(int port,
String host,
String requestURI)
Create an HTTP PATCH request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
patch(int port,
String host,
UriTemplate requestURI)
Create an HTTP PATCH request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
patch(String requestURI)
Create an HTTP PATCH request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
patch(String host,
String requestURI)
Create an HTTP PATCH request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
patch(String host,
UriTemplate requestURI)
Create an HTTP PATCH request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
patch(UriTemplate requestURI)
Create an HTTP PATCH request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
patchAbs(String absoluteURI)
Create an HTTP PATCH request to send to the server using an absolute URI, specifying a response handler to receive
the response
|
HttpRequest<Buffer> |
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<Buffer> |
post(int port,
String host,
String requestURI)
Create an HTTP POST request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
post(int port,
String host,
UriTemplate requestURI)
Create an HTTP POST request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
post(String requestURI)
Create an HTTP POST request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
post(String host,
String requestURI)
Create an HTTP POST request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
post(String host,
UriTemplate requestURI)
Create an HTTP POST request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
post(UriTemplate requestURI)
Create an HTTP POST request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
postAbs(String absoluteURI)
Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive
the response
|
HttpRequest<Buffer> |
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<Buffer> |
put(int port,
String host,
String requestURI)
Create an HTTP PUT request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
put(int port,
String host,
UriTemplate requestURI)
Create an HTTP PUT request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
put(String requestURI)
Create an HTTP PUT request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
put(String host,
String requestURI)
Create an HTTP PUT request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
put(String host,
UriTemplate requestURI)
Create an HTTP PUT request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
put(UriTemplate requestURI)
Create an HTTP PUT request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
putAbs(String absoluteURI)
Create an HTTP PUT request to send to the server using an absolute URI, specifying a response handler to receive
the response
|
HttpRequest<Buffer> |
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<Buffer> |
request(HttpMethod method,
int port,
String host,
String requestURI)
Create an HTTP request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
request(HttpMethod method,
int port,
String host,
UriTemplate requestURI)
Create an HTTP request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
request(HttpMethod method,
RequestOptions options)
Create an HTTP request to send to the server at the specified host and port.
|
HttpRequest<Buffer> |
request(HttpMethod method,
SocketAddress serverAddress,
int port,
String host,
String requestURI)
Like
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String) using the serverAddress parameter to connect to the
server instead of the port and host parameters. |
HttpRequest<Buffer> |
request(HttpMethod method,
SocketAddress serverAddress,
int port,
String host,
UriTemplate requestURI)
Like
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String) using the serverAddress parameter to connect to the
server instead of the port and host parameters. |
HttpRequest<Buffer> |
request(HttpMethod method,
SocketAddress serverAddress,
RequestOptions options)
Like
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String) using the serverAddress parameter to connect to the
server instead of the options parameter. |
HttpRequest<Buffer> |
request(HttpMethod method,
SocketAddress serverAddress,
String requestURI)
Like
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String) using the serverAddress parameter to connect to the
server instead of the default port and default host. |
HttpRequest<Buffer> |
request(HttpMethod method,
SocketAddress serverAddress,
String host,
String requestURI)
Like
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String) using the serverAddress parameter to connect to the
server instead of the default port and host parameter. |
HttpRequest<Buffer> |
request(HttpMethod method,
SocketAddress serverAddress,
String host,
UriTemplate requestURI)
Like
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String) using the serverAddress parameter to connect to the
server instead of the default port and host parameter. |
HttpRequest<Buffer> |
request(HttpMethod method,
SocketAddress serverAddress,
UriTemplate requestURI)
Like
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String) using the serverAddress parameter to connect to the
server instead of the default port and default host. |
HttpRequest<Buffer> |
request(HttpMethod method,
String requestURI)
Create an HTTP request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
request(HttpMethod method,
String host,
String requestURI)
Create an HTTP request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
request(HttpMethod method,
String host,
UriTemplate requestURI)
Create an HTTP request to send to the server at the specified host and default port.
|
HttpRequest<Buffer> |
request(HttpMethod method,
UriTemplate requestURI)
Create an HTTP request to send to the server at the default host and port.
|
HttpRequest<Buffer> |
requestAbs(HttpMethod method,
SocketAddress serverAddress,
String absoluteURI)
Like
requestAbs(io.vertx.core.http.HttpMethod, java.lang.String) using the serverAddress parameter to connect to the
server instead of the absoluteURI parameter. |
HttpRequest<Buffer> |
requestAbs(HttpMethod method,
SocketAddress serverAddress,
UriTemplate absoluteURI)
Like
requestAbs(io.vertx.core.http.HttpMethod, java.lang.String) using the serverAddress parameter to connect to the
server instead of the absoluteURI parameter. |
HttpRequest<Buffer> |
requestAbs(HttpMethod method,
String absoluteURI)
Create an HTTP request to send to the server using an absolute URI
|
HttpRequest<Buffer> |
requestAbs(HttpMethod method,
UriTemplate absoluteURI)
Create an HTTP request to send to the server using an absolute URI
|
String |
toString() |
static WebClient |
wrap(HttpClient httpClient)
Wrap an
httpClient with a web client and default options. |
static WebClient |
wrap(HttpClient httpClient,
WebClientOptions options)
Wrap an
httpClient with a web client and default options. |
public static final io.vertx.lang.rx.TypeArg<WebClient> __TYPE_ARG
public WebClient(WebClient delegate)
public WebClient(Object delegate)
public WebClient getDelegate()
public static WebClient create(Vertx vertx)
vertx
instance and default options.vertx
- the vertx instancepublic static WebClient create(Vertx vertx, WebClientOptions options)
vertx
instance.vertx
- the vertx instanceoptions
- the Web Client optionspublic static WebClient wrap(HttpClient httpClient)
httpClient
with a web client and default options.httpClient
- the to wrappublic static WebClient wrap(HttpClient httpClient, WebClientOptions options)
httpClient
with a web client and default options.
Only the specific web client portion of the options
is used, the HttpClientOptions
of the httpClient
is reused.
httpClient
- the to wrapoptions
- the Web Client optionspublic HttpRequest<Buffer> request(HttpMethod method, int port, String host, String requestURI)
method
- the HTTP methodport
- the porthost
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> request(HttpMethod method, int port, String host, UriTemplate requestURI)
method
- the HTTP methodport
- the porthost
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, int port, String host, String requestURI)
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)
using the serverAddress
parameter to connect to the
server instead of the port
and host
parameters.
The request host header will still be created from the port
and host
parameters.
Use to connect to a unix domain socket server.
method
- serverAddress
- port
- host
- requestURI
- public HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, int port, String host, UriTemplate requestURI)
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)
using the serverAddress
parameter to connect to the
server instead of the port
and host
parameters.
The request host header will still be created from the port
and host
parameters.
Use to connect to a unix domain socket server.
method
- serverAddress
- port
- host
- requestURI
- public HttpRequest<Buffer> request(HttpMethod method, String host, String requestURI)
method
- the HTTP methodhost
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> request(HttpMethod method, String host, UriTemplate requestURI)
method
- the HTTP methodhost
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, String host, String requestURI)
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)
using the serverAddress
parameter to connect to the
server instead of the default port and host
parameter.
The request host header will still be created from the default port and host
parameter.
Use to connect to a unix domain socket server.
method
- serverAddress
- host
- requestURI
- public HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, String host, UriTemplate requestURI)
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)
using the serverAddress
parameter to connect to the
server instead of the default port and host
parameter.
The request host header will still be created from the default port and host
parameter.
Use to connect to a unix domain socket server.
method
- serverAddress
- host
- requestURI
- public HttpRequest<Buffer> request(HttpMethod method, String requestURI)
method
- the HTTP methodrequestURI
- the request URIpublic HttpRequest<Buffer> request(HttpMethod method, UriTemplate requestURI)
method
- the HTTP methodrequestURI
- the request URI as apublic HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, String requestURI)
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)
using the serverAddress
parameter to connect to the
server instead of the default port and default host.
The request host header will still be created from the default port and default host.
Use to connect to a unix domain socket server.
method
- serverAddress
- requestURI
- public HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, UriTemplate requestURI)
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)
using the serverAddress
parameter to connect to the
server instead of the default port and default host.
The request host header will still be created from the default port and default host.
Use to connect to a unix domain socket server.
method
- serverAddress
- requestURI
- public HttpRequest<Buffer> request(HttpMethod method, RequestOptions options)
method
- the HTTP methodoptions
- the request optionspublic HttpRequest<Buffer> request(HttpMethod method, SocketAddress serverAddress, RequestOptions options)
request(io.vertx.core.http.HttpMethod, int, java.lang.String, java.lang.String)
using the serverAddress
parameter to connect to the
server instead of the options
parameter.
The request host header will still be created from the options
parameter.
Use to connect to a unix domain socket server.
method
- serverAddress
- options
- public HttpRequest<Buffer> requestAbs(HttpMethod method, String absoluteURI)
method
- the HTTP methodabsoluteURI
- the absolute URIpublic HttpRequest<Buffer> requestAbs(HttpMethod method, UriTemplate absoluteURI)
method
- the HTTP methodabsoluteURI
- the absolute URI as apublic HttpRequest<Buffer> requestAbs(HttpMethod method, SocketAddress serverAddress, String absoluteURI)
requestAbs(io.vertx.core.http.HttpMethod, java.lang.String)
using the serverAddress
parameter to connect to the
server instead of the absoluteURI
parameter.
The request host header will still be created from the absoluteURI
parameter.
Use to connect to a unix domain socket server.
method
- serverAddress
- absoluteURI
- public HttpRequest<Buffer> requestAbs(HttpMethod method, SocketAddress serverAddress, UriTemplate absoluteURI)
requestAbs(io.vertx.core.http.HttpMethod, java.lang.String)
using the serverAddress
parameter to connect to the
server instead of the absoluteURI
parameter.
The request host header will still be created from the absoluteURI
parameter.
Use to connect to a unix domain socket server.
method
- serverAddress
- absoluteURI
- public HttpRequest<Buffer> get(String requestURI)
requestURI
- the request URIpublic HttpRequest<Buffer> get(UriTemplate requestURI)
requestURI
- the request URI as apublic HttpRequest<Buffer> get(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> get(int port, String host, UriTemplate requestURI)
port
- the porthost
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> get(String host, String requestURI)
host
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> get(String host, UriTemplate requestURI)
host
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> getAbs(String absoluteURI)
absoluteURI
- the absolute URIpublic HttpRequest<Buffer> getAbs(UriTemplate absoluteURI)
absoluteURI
- the absolute URI as apublic HttpRequest<Buffer> post(String requestURI)
requestURI
- the request URIpublic HttpRequest<Buffer> post(UriTemplate requestURI)
requestURI
- the request URI as apublic HttpRequest<Buffer> post(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> post(int port, String host, UriTemplate requestURI)
port
- the porthost
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> post(String host, String requestURI)
host
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> post(String host, UriTemplate requestURI)
host
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> postAbs(String absoluteURI)
absoluteURI
- the absolute URIpublic HttpRequest<Buffer> postAbs(UriTemplate absoluteURI)
absoluteURI
- the absoluate URI as apublic HttpRequest<Buffer> put(String requestURI)
requestURI
- the request URIpublic HttpRequest<Buffer> put(UriTemplate requestURI)
requestURI
- the request URI as apublic HttpRequest<Buffer> put(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> put(int port, String host, UriTemplate requestURI)
port
- the porthost
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> put(String host, String requestURI)
host
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> put(String host, UriTemplate requestURI)
host
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> putAbs(String absoluteURI)
absoluteURI
- the absolute URIpublic HttpRequest<Buffer> putAbs(UriTemplate absoluteURI)
absoluteURI
- the absolute URI as apublic HttpRequest<Buffer> delete(String requestURI)
requestURI
- the request URIpublic HttpRequest<Buffer> delete(UriTemplate requestURI)
requestURI
- the request URI as apublic HttpRequest<Buffer> delete(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> delete(int port, String host, UriTemplate requestURI)
port
- the porthost
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> delete(String host, String requestURI)
host
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> delete(String host, UriTemplate requestURI)
host
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> deleteAbs(String absoluteURI)
absoluteURI
- the absolute URIpublic HttpRequest<Buffer> deleteAbs(UriTemplate absoluteURI)
absoluteURI
- the absolute URI as apublic HttpRequest<Buffer> patch(String requestURI)
requestURI
- the request URIpublic HttpRequest<Buffer> patch(UriTemplate requestURI)
requestURI
- the request URI as apublic HttpRequest<Buffer> patch(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> patch(int port, String host, UriTemplate requestURI)
port
- the porthost
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> patch(String host, String requestURI)
host
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> patch(String host, UriTemplate requestURI)
host
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> patchAbs(String absoluteURI)
absoluteURI
- the absolute URIpublic HttpRequest<Buffer> patchAbs(UriTemplate absoluteURI)
absoluteURI
- the absolute URI as apublic HttpRequest<Buffer> head(String requestURI)
requestURI
- the request URIpublic HttpRequest<Buffer> head(UriTemplate requestURI)
requestURI
- the request URI as apublic HttpRequest<Buffer> head(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> head(int port, String host, UriTemplate requestURI)
port
- the porthost
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> head(String host, String requestURI)
host
- the hostrequestURI
- the request URIpublic HttpRequest<Buffer> head(String host, UriTemplate requestURI)
host
- the hostrequestURI
- the request URI as apublic HttpRequest<Buffer> headAbs(String absoluteURI)
absoluteURI
- the absolute URIpublic HttpRequest<Buffer> headAbs(UriTemplate absoluteURI)
absoluteURI
- the absolute URI as apublic void close()
Copyright © 2024 Eclipse. All rights reserved.