Package io.vertx.mutiny.ext.web.client
Class WebClient
- java.lang.Object
-
- io.vertx.mutiny.ext.web.client.WebClient
-
- Direct Known Subclasses:
WebClientSession
public class WebClient extends Object
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 , it is actually based on it and therefore inherits its configuration and great features like pooling. The
NOTE: This class has been automatically generated from theHttpClient
should be used when fine grained control over the HTTP requests/response is necessary.original
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<WebClient>
__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static WebClient
create(Vertx vertx)
static WebClient
create(Vertx vertx, io.vertx.ext.web.client.WebClientOptions options)
HttpRequest<Buffer>
delete(int port, String host, String requestURI)
HttpRequest<Buffer>
delete(String requestURI)
HttpRequest<Buffer>
delete(String host, String requestURI)
HttpRequest<Buffer>
deleteAbs(String absoluteURI)
boolean
equals(Object o)
HttpRequest<Buffer>
get(int port, String host, String requestURI)
HttpRequest<Buffer>
get(String requestURI)
HttpRequest<Buffer>
get(String host, String requestURI)
HttpRequest<Buffer>
getAbs(String absoluteURI)
io.vertx.ext.web.client.WebClient
getDelegate()
int
hashCode()
HttpRequest<Buffer>
head(int port, String host, String requestURI)
HttpRequest<Buffer>
head(String requestURI)
HttpRequest<Buffer>
head(String host, String requestURI)
HttpRequest<Buffer>
headAbs(String absoluteURI)
static WebClient
newInstance(io.vertx.ext.web.client.WebClient arg)
HttpRequest<Buffer>
patch(int port, String host, String requestURI)
HttpRequest<Buffer>
patch(String requestURI)
HttpRequest<Buffer>
patch(String host, String requestURI)
HttpRequest<Buffer>
patchAbs(String absoluteURI)
HttpRequest<Buffer>
post(int port, String host, String requestURI)
HttpRequest<Buffer>
post(String requestURI)
HttpRequest<Buffer>
post(String host, String requestURI)
HttpRequest<Buffer>
postAbs(String absoluteURI)
HttpRequest<Buffer>
put(int port, String host, String requestURI)
HttpRequest<Buffer>
put(String requestURI)
HttpRequest<Buffer>
put(String host, String requestURI)
HttpRequest<Buffer>
putAbs(String absoluteURI)
HttpRequest<Buffer>
request(io.vertx.core.http.HttpMethod method, int port, String host, String requestURI)
HttpRequest<Buffer>
request(io.vertx.core.http.HttpMethod method, io.vertx.core.http.RequestOptions options)
HttpRequest<Buffer>
request(io.vertx.core.http.HttpMethod method, SocketAddress serverAddress, int port, String host, String requestURI)
HttpRequest<Buffer>
request(io.vertx.core.http.HttpMethod method, SocketAddress serverAddress, io.vertx.core.http.RequestOptions options)
HttpRequest<Buffer>
request(io.vertx.core.http.HttpMethod method, SocketAddress serverAddress, String requestURI)
HttpRequest<Buffer>
request(io.vertx.core.http.HttpMethod method, SocketAddress serverAddress, String host, String requestURI)
HttpRequest<Buffer>
request(io.vertx.core.http.HttpMethod method, String requestURI)
HttpRequest<Buffer>
request(io.vertx.core.http.HttpMethod method, String host, String requestURI)
HttpRequest<Buffer>
requestAbs(io.vertx.core.http.HttpMethod method, SocketAddress serverAddress, String absoluteURI)
HttpRequest<Buffer>
requestAbs(io.vertx.core.http.HttpMethod method, String absoluteURI)
String
toString()
static WebClient
wrap(HttpClient httpClient)
static WebClient
wrap(HttpClient httpClient, io.vertx.ext.web.client.WebClientOptions options)
-
-
-
Constructor Detail
-
WebClient
public WebClient(io.vertx.ext.web.client.WebClient delegate)
-
WebClient
public WebClient(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.web.client.WebClient getDelegate()
-
create
public static WebClient create(Vertx vertx)
- Parameters:
vertx
- the vertx instance- Returns:
- the created web client
-
create
public static WebClient create(Vertx vertx, io.vertx.ext.web.client.WebClientOptions options)
- Parameters:
vertx
- the vertx instanceoptions
- the Web Client options- Returns:
- the created web client
-
wrap
public static WebClient wrap(HttpClient httpClient)
- Parameters:
httpClient
- the to wrap- Returns:
- the web client
-
wrap
public static WebClient wrap(HttpClient httpClient, io.vertx.ext.web.client.WebClientOptions options)
- Parameters:
httpClient
- the to wrapoptions
- the Web Client options- Returns:
- the web client
-
request
public HttpRequest<Buffer> request(io.vertx.core.http.HttpMethod method, int port, String host, String requestURI)
- Parameters:
method
- the HTTP methodport
- the porthost
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
request
public HttpRequest<Buffer> request(io.vertx.core.http.HttpMethod method, SocketAddress serverAddress, int port, String host, String requestURI)
- Parameters:
method
-serverAddress
-port
-host
-requestURI
-- Returns:
-
request
public HttpRequest<Buffer> request(io.vertx.core.http.HttpMethod method, String host, String requestURI)
- Parameters:
method
- the HTTP methodhost
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
request
public HttpRequest<Buffer> request(io.vertx.core.http.HttpMethod method, SocketAddress serverAddress, String host, String requestURI)
- Parameters:
method
-serverAddress
-host
-requestURI
-- Returns:
-
request
public HttpRequest<Buffer> request(io.vertx.core.http.HttpMethod method, String requestURI)
- Parameters:
method
- the HTTP methodrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
request
public HttpRequest<Buffer> request(io.vertx.core.http.HttpMethod method, SocketAddress serverAddress, String requestURI)
- Parameters:
method
-serverAddress
-requestURI
-- Returns:
-
request
public HttpRequest<Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.http.RequestOptions options)
- Parameters:
method
- the HTTP methodoptions
- the request options- Returns:
- an HTTP client request object
-
request
public HttpRequest<Buffer> request(io.vertx.core.http.HttpMethod method, SocketAddress serverAddress, io.vertx.core.http.RequestOptions options)
- Parameters:
method
-serverAddress
-options
-- Returns:
-
requestAbs
public HttpRequest<Buffer> requestAbs(io.vertx.core.http.HttpMethod method, String absoluteURI)
- Parameters:
method
- the HTTP methodabsoluteURI
- the absolute URI- Returns:
- an HTTP client request object
-
requestAbs
public HttpRequest<Buffer> requestAbs(io.vertx.core.http.HttpMethod method, SocketAddress serverAddress, String absoluteURI)
- Parameters:
method
-serverAddress
-absoluteURI
-- Returns:
-
get
public HttpRequest<Buffer> get(String requestURI)
- Parameters:
requestURI
- the relative URI- Returns:
- an HTTP client request object
-
get
public HttpRequest<Buffer> get(int port, String host, String requestURI)
- Parameters:
port
- the porthost
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
get
public HttpRequest<Buffer> get(String host, String requestURI)
- Parameters:
host
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
getAbs
public HttpRequest<Buffer> getAbs(String absoluteURI)
- Parameters:
absoluteURI
- the absolute URI- Returns:
- an HTTP client request object
-
post
public HttpRequest<Buffer> post(String requestURI)
- Parameters:
requestURI
- the relative URI- Returns:
- an HTTP client request object
-
post
public HttpRequest<Buffer> post(int port, String host, String requestURI)
- Parameters:
port
- the porthost
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
post
public HttpRequest<Buffer> post(String host, String requestURI)
- Parameters:
host
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
postAbs
public HttpRequest<Buffer> postAbs(String absoluteURI)
- Parameters:
absoluteURI
- the absolute URI- Returns:
- an HTTP client request object
-
put
public HttpRequest<Buffer> put(String requestURI)
- Parameters:
requestURI
- the relative URI- Returns:
- an HTTP client request object
-
put
public HttpRequest<Buffer> put(int port, String host, String requestURI)
- Parameters:
port
- the porthost
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
put
public HttpRequest<Buffer> put(String host, String requestURI)
- Parameters:
host
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
putAbs
public HttpRequest<Buffer> putAbs(String absoluteURI)
- Parameters:
absoluteURI
- the absolute URI- Returns:
- an HTTP client request object
-
delete
public HttpRequest<Buffer> delete(String requestURI)
- Parameters:
requestURI
- the relative URI- Returns:
- an HTTP client request object
-
delete
public HttpRequest<Buffer> delete(int port, String host, String requestURI)
- Parameters:
port
- the porthost
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
delete
public HttpRequest<Buffer> delete(String host, String requestURI)
- Parameters:
host
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
deleteAbs
public HttpRequest<Buffer> deleteAbs(String absoluteURI)
- Parameters:
absoluteURI
- the absolute URI- Returns:
- an HTTP client request object
-
patch
public HttpRequest<Buffer> patch(String requestURI)
- Parameters:
requestURI
- the relative URI- Returns:
- an HTTP client request object
-
patch
public HttpRequest<Buffer> patch(int port, String host, String requestURI)
- Parameters:
port
- the porthost
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
patch
public HttpRequest<Buffer> patch(String host, String requestURI)
- Parameters:
host
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
patchAbs
public HttpRequest<Buffer> patchAbs(String absoluteURI)
- Parameters:
absoluteURI
- the absolute URI- Returns:
- an HTTP client request object
-
head
public HttpRequest<Buffer> head(String requestURI)
- Parameters:
requestURI
- the relative URI- Returns:
- an HTTP client request object
-
head
public HttpRequest<Buffer> head(int port, String host, String requestURI)
- Parameters:
port
- the porthost
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
head
public HttpRequest<Buffer> head(String host, String requestURI)
- Parameters:
host
- the hostrequestURI
- the relative URI- Returns:
- an HTTP client request object
-
headAbs
public HttpRequest<Buffer> headAbs(String absoluteURI)
- Parameters:
absoluteURI
- the absolute URI- Returns:
- an HTTP client request object
-
close
public void close()
-
newInstance
public static WebClient newInstance(io.vertx.ext.web.client.WebClient arg)
-
-