public interface WebClient
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 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.
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the client.
|
static WebClient |
create(io.vertx.core.Vertx vertx)
Create a web client using the provided
vertx instance and default options. |
static WebClient |
create(io.vertx.core.Vertx vertx,
WebClientOptions options)
Create a web client using the provided
vertx instance. |
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(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,
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(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<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(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,
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(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<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(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,
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(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<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(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,
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(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,
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(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,
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(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,
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(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,
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(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,
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)
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,
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,
String requestURI)
Create an HTTP request to send to the server at the specified host and default port.
|
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
|
static WebClient |
wrap(io.vertx.core.http.HttpClient httpClient)
Wrap an
httpClient with a web client and default options. |
static WebClient |
wrap(io.vertx.core.http.HttpClient httpClient,
WebClientOptions options)
Wrap an
httpClient with a web client and default options. |
static WebClient create(io.vertx.core.Vertx vertx)
vertx
instance and default options.vertx
- the vertx instancestatic WebClient create(io.vertx.core.Vertx vertx, WebClientOptions options)
vertx
instance.vertx
- the vertx instanceoptions
- the Web Client optionsstatic WebClient wrap(io.vertx.core.http.HttpClient httpClient)
httpClient
with a web client and default options.httpClient
- the HttpClient
to wrapstatic WebClient wrap(io.vertx.core.http.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 HttpClient
to wrapoptions
- the Web Client optionsHttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, int port, String host, String requestURI)
method
- the HTTP methodport
- the porthost
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, String host, String requestURI)
method
- the HTTP methodhost
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, String requestURI)
method
- the HTTP methodrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.http.RequestOptions options)
method
- the HTTP methodoptions
- the request optionsHttpRequest<io.vertx.core.buffer.Buffer> requestAbs(io.vertx.core.http.HttpMethod method, String absoluteURI)
method
- the HTTP methodabsoluteURI
- the absolute URIHttpRequest<io.vertx.core.buffer.Buffer> get(String requestURI)
requestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> get(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> get(String host, String requestURI)
host
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> getAbs(String absoluteURI)
absoluteURI
- the absolute URIHttpRequest<io.vertx.core.buffer.Buffer> post(String requestURI)
requestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> post(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> post(String host, String requestURI)
host
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> postAbs(String absoluteURI)
absoluteURI
- the absolute URIHttpRequest<io.vertx.core.buffer.Buffer> put(String requestURI)
requestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> put(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> put(String host, String requestURI)
host
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> putAbs(String absoluteURI)
absoluteURI
- the absolute URIHttpRequest<io.vertx.core.buffer.Buffer> delete(String requestURI)
requestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> delete(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> delete(String host, String requestURI)
host
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> deleteAbs(String absoluteURI)
absoluteURI
- the absolute URIHttpRequest<io.vertx.core.buffer.Buffer> patch(String requestURI)
requestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> patch(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> patch(String host, String requestURI)
host
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> patchAbs(String absoluteURI)
absoluteURI
- the absolute URIHttpRequest<io.vertx.core.buffer.Buffer> head(String requestURI)
requestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> head(int port, String host, String requestURI)
port
- the porthost
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> head(String host, String requestURI)
host
- the hostrequestURI
- the relative URIHttpRequest<io.vertx.core.buffer.Buffer> headAbs(String absoluteURI)
absoluteURI
- the absolute URIvoid close()
Copyright © 2017. All rights reserved.