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(Vertx vertx)
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(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> |
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> |
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(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> |
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> |
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(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> |
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> |
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(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> |
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> |
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(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> |
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> |
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(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> |
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> |
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,
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> |
requestAbs(HttpMethod method,
String absoluteURI)
Create an HTTP request to send to the server using an absolute URI
|
static WebClient |
wrap(HttpClient httpClient)
Wrap an
httpClient with a web client. |
static WebClient create(Vertx vertx)
vertx instance.vertx - the vertx instancestatic WebClient wrap(HttpClient httpClient)
httpClient with a web client.httpClient - the HttpClient to wrapHttpRequest<Buffer> request(HttpMethod method, int port, String host, String requestURI)
method - the HTTP methodport - the porthost - the hostrequestURI - the relative URIHttpRequest<Buffer> request(HttpMethod method, String host, String requestURI)
method - the HTTP methodhost - the hostrequestURI - the relative URIHttpRequest<Buffer> request(HttpMethod method, String requestURI)
method - the HTTP methodrequestURI - the relative URIHttpRequest<Buffer> requestAbs(HttpMethod method, String absoluteURI)
method - the HTTP methodabsoluteURI - the absolute URIHttpRequest<Buffer> get(String requestURI)
requestURI - the relative URIHttpRequest<Buffer> get(int port, String host, String requestURI)
port - the porthost - the hostrequestURI - the relative URIHttpRequest<Buffer> get(String host, String requestURI)
host - the hostrequestURI - the relative URIHttpRequest<Buffer> getAbs(String absoluteURI)
absoluteURI - the absolute URIHttpRequest<Buffer> post(String requestURI)
requestURI - the relative URIHttpRequest<Buffer> post(int port, String host, String requestURI)
port - the porthost - the hostrequestURI - the relative URIHttpRequest<Buffer> post(String host, String requestURI)
host - the hostrequestURI - the relative URIHttpRequest<Buffer> postAbs(String absoluteURI)
absoluteURI - the absolute URIHttpRequest<Buffer> put(String requestURI)
requestURI - the relative URIHttpRequest<Buffer> put(int port, String host, String requestURI)
port - the porthost - the hostrequestURI - the relative URIHttpRequest<Buffer> put(String host, String requestURI)
host - the hostrequestURI - the relative URIHttpRequest<Buffer> putAbs(String absoluteURI)
absoluteURI - the absolute URIHttpRequest<Buffer> delete(String requestURI)
requestURI - the relative URIHttpRequest<Buffer> delete(int port, String host, String requestURI)
port - the porthost - the hostrequestURI - the relative URIHttpRequest<Buffer> delete(String host, String requestURI)
host - the hostrequestURI - the relative URIHttpRequest<Buffer> deleteAbs(String absoluteURI)
absoluteURI - the absolute URIHttpRequest<Buffer> patch(String requestURI)
requestURI - the relative URIHttpRequest<Buffer> patch(int port, String host, String requestURI)
port - the porthost - the hostrequestURI - the relative URIHttpRequest<Buffer> patch(String host, String requestURI)
host - the hostrequestURI - the relative URIHttpRequest<Buffer> patchAbs(String absoluteURI)
absoluteURI - the absolute URIHttpRequest<Buffer> head(String requestURI)
requestURI - the relative URIHttpRequest<Buffer> head(int port, String host, String requestURI)
port - the porthost - the hostrequestURI - the relative URIHttpRequest<Buffer> head(String host, String requestURI)
host - the hostrequestURI - the relative URIHttpRequest<Buffer> headAbs(String absoluteURI)
absoluteURI - the absolute URIvoid close()
Copyright © 2017. All rights reserved.