Class WebClient
- All Implemented Interfaces:
MutinyDelegate
- Direct Known Subclasses:
OAuth2WebClient,WebClientSession
WebClient.
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. The HttpClient should be used when fine grained control over the HTTP
requests/response is necessary.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Julien Viet
- See Also:
-
WebClient
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the client.static WebClientCreate a web client using the providedvertxinstance and default options.static WebClientCreate a web client using the providedvertxinstance and default pooling options.static WebClientcreate(Vertx vertx, io.vertx.ext.web.client.WebClientConfig config, io.vertx.core.http.PoolOptions poolOptions) Create a web client using the providedvertxinstance.static WebClientcreate(Vertx vertx, io.vertx.ext.web.client.WebClientConfig config, io.vertx.core.net.ClientSSLOptions sslOptions) Create a web client using the providedvertxinstance, SSL options and default pooling options.static WebClientcreate(Vertx vertx, io.vertx.ext.web.client.WebClientConfig config, io.vertx.core.net.ClientSSLOptions sslOptions, io.vertx.core.http.PoolOptions poolOptions) Create a web client using the providedvertxinstance and SSL options.static WebClientCreate a web client using the providedvertxinstance and default pooling options.static WebClientcreate(Vertx vertx, io.vertx.ext.web.client.WebClientOptions options, io.vertx.core.http.PoolOptions poolOptions) Create a web client using the providedvertxinstance.HttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>Create an HTTP DELETE request to send to the server at the specified host and port.HttpRequest<io.vertx.core.buffer.Buffer>delete(UriTemplate requestURI) Create an HTTP DELETE request to send to the server at the default host and port.HttpRequest<io.vertx.core.buffer.Buffer>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, UriTemplate requestURI) Create an HTTP DELETE request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.Buffer>Create an HTTP DELETE request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.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 responseHttpRequest<io.vertx.core.buffer.Buffer>Create an HTTP DELETE request to send to the server using an absolute URI, specifying a response handler to receive the responsebooleanHttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>Create an HTTP GET request to send to the server at the specified host and port.HttpRequest<io.vertx.core.buffer.Buffer>get(UriTemplate requestURI) Create an HTTP GET request to send to the server at the default host and port.HttpRequest<io.vertx.core.buffer.Buffer>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, UriTemplate requestURI) Create an HTTP GET request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.Buffer>Create an HTTP GET request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.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 responseHttpRequest<io.vertx.core.buffer.Buffer>Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive the responseio.vertx.ext.web.client.WebClientGet the delegate instance.inthashCode()HttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>Create an HTTP HEAD request to send to the server at the specified host and port.HttpRequest<io.vertx.core.buffer.Buffer>head(UriTemplate requestURI) Create an HTTP HEAD request to send to the server at the default host and port.HttpRequest<io.vertx.core.buffer.Buffer>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, UriTemplate requestURI) Create an HTTP HEAD request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.Buffer>Create an HTTP HEAD request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.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 responseHttpRequest<io.vertx.core.buffer.Buffer>Create an HTTP HEAD request to send to the server using an absolute URI, specifying a response handler to receive the responsestatic WebClientnewInstance(io.vertx.ext.web.client.WebClient delegate) Creates a new instance of theWebClient.HttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>Create an HTTP PATCH request to send to the server at the specified host and port.HttpRequest<io.vertx.core.buffer.Buffer>patch(UriTemplate requestURI) Create an HTTP PATCH request to send to the server at the default host and port.HttpRequest<io.vertx.core.buffer.Buffer>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, UriTemplate requestURI) Create an HTTP PATCH request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.Buffer>Create an HTTP PATCH request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.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 responseHttpRequest<io.vertx.core.buffer.Buffer>Create an HTTP PATCH request to send to the server using an absolute URI, specifying a response handler to receive the responseHttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>Create an HTTP POST request to send to the server at the specified host and port.HttpRequest<io.vertx.core.buffer.Buffer>post(UriTemplate requestURI) Create an HTTP POST request to send to the server at the default host and port.HttpRequest<io.vertx.core.buffer.Buffer>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, UriTemplate requestURI) Create an HTTP POST request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.Buffer>Create an HTTP POST request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.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 responseHttpRequest<io.vertx.core.buffer.Buffer>Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive the responseHttpRequest<io.vertx.core.buffer.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<io.vertx.core.buffer.Buffer>Create an HTTP PUT request to send to the server at the specified host and port.HttpRequest<io.vertx.core.buffer.Buffer>put(UriTemplate requestURI) Create an HTTP PUT request to send to the server at the default host and port.HttpRequest<io.vertx.core.buffer.Buffer>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, UriTemplate requestURI) Create an HTTP PUT request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.Buffer>Create an HTTP PUT request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.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 responseHttpRequest<io.vertx.core.buffer.Buffer>Create an HTTP PUT request to send to the server using an absolute URI, specifying a response handler to receive the responseHttpRequest<io.vertx.core.buffer.Buffer>request(io.vertx.core.http.HttpMethod method, int port, String host, UriTemplate requestURI) Create an HTTP request to send to the server at the specified host and port.HttpRequest<io.vertx.core.buffer.Buffer>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) Deprecated.HttpRequest<io.vertx.core.buffer.Buffer>request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, int port, String host, UriTemplate requestURI) Likerequest(HttpMethod, int, String, UriTemplate)using theserverAddressparameter to connect to the server instead of theportandhostparameters.HttpRequest<io.vertx.core.buffer.Buffer>request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, int port, String host, String requestURI) Likerequest(HttpMethod, int, String, String)using theserverAddressparameter to connect to the server instead of theportandhostparameters.HttpRequest<io.vertx.core.buffer.Buffer>request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, io.vertx.core.http.RequestOptions options) Deprecated.instead userequest(RequestOptions)HttpRequest<io.vertx.core.buffer.Buffer>request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, UriTemplate requestURI) Likerequest(HttpMethod, UriTemplate)using theserverAddressparameter to connect to the server instead of the default port and default host.HttpRequest<io.vertx.core.buffer.Buffer>request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String requestURI) Likerequest(HttpMethod, String)using theserverAddressparameter to connect to the server instead of the default port and default host.HttpRequest<io.vertx.core.buffer.Buffer>request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String host, UriTemplate requestURI) Likerequest(HttpMethod, String, UriTemplate)using theserverAddressparameter to connect to the server instead of the default port andhostparameter.HttpRequest<io.vertx.core.buffer.Buffer>request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String host, String requestURI) Likerequest(HttpMethod, String, String)using theserverAddressparameter to connect to the server instead of the default port andhostparameter.HttpRequest<io.vertx.core.buffer.Buffer>request(io.vertx.core.http.HttpMethod method, UriTemplate requestURI) Create an HTTP request to send to the server at the default host and port.HttpRequest<io.vertx.core.buffer.Buffer>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, UriTemplate requestURI) Create an HTTP request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.Buffer>Create an HTTP request to send to the server at the specified host and default port.HttpRequest<io.vertx.core.buffer.Buffer>request(io.vertx.core.http.RequestOptions options) Create an HTTP request to send to the server from the specified requestoptions.HttpRequest<io.vertx.core.buffer.Buffer>requestAbs(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, UriTemplate absoluteURI) LikerequestAbs(HttpMethod, UriTemplate)using theserverAddressparameter to connect to the server instead of theabsoluteURIparameter.HttpRequest<io.vertx.core.buffer.Buffer>requestAbs(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String absoluteURI) LikerequestAbs(HttpMethod, String)using theserverAddressparameter to connect to the server instead of theabsoluteURIparameter.HttpRequest<io.vertx.core.buffer.Buffer>requestAbs(io.vertx.core.http.HttpMethod method, UriTemplate absoluteURI) Create an HTTP request to send to the server using an absolute URIHttpRequest<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 URItoString()io.smallrye.mutiny.Uni<Boolean>updateSSLOptions(io.vertx.core.net.ClientSSLOptions options) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.io.smallrye.mutiny.Uni<Boolean>updateSSLOptions(io.vertx.core.net.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.updateSSLOptionsAndAwait(io.vertx.core.net.ClientSSLOptions options) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndAwait(io.vertx.core.net.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.updateSSLOptionsAndForget(io.vertx.core.net.ClientSSLOptions options) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndForget(io.vertx.core.net.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 WebClientwrap(HttpClient httpClient) Wrap anhttpClientwith a web client and default options.static WebClientwrap(HttpClient httpClient, io.vertx.ext.web.client.WebClientOptions options) Wrap anhttpClientwith a web client and default options.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
WebClient
public WebClient(io.vertx.ext.web.client.WebClient delegate) Create a new instance ofWebClientdelegating to the given (non-null) instance ofWebClient. -
WebClient
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.client.WebClient getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
updateSSLOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.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 uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
options- the new SSL options- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
WebClient.updateSSLOptions(ClientSSLOptions)
-
updateSSLOptionsAndAwait
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 underlying uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method returns a
Boolean. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
options- the new SSL options- Returns:
- The operation result
- See Also:
-
WebClient.updateSSLOptions(ClientSSLOptions)
-
updateSSLOptionsAndForget
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 underlying uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method ignores the
Booleanresult or any failure.- Parameters:
options- the new SSL options- Returns:
- The current instance to chain operations if needed.
- See Also:
-
WebClient.updateSSLOptions(ClientSSLOptions)
-
updateSSLOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.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
optionsobject is compared using itsequalsmethod 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, settingforcetotrueforces the update.The boolean succeeded uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
options- the new SSL optionsforce- force the update when options are equals- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
WebClient.updateSSLOptions(ClientSSLOptions, boolean)
-
updateSSLOptionsAndAwait
Update the client with new SSL
options, the update happens if the options object is valid and different from the existing options object.The
optionsobject is compared using itsequalsmethod 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, settingforcetotrueforces the update.The boolean succeeded underlying uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method returns a
Boolean. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
options- the new SSL optionsforce- force the update when options are equals- Returns:
- The operation result
- See Also:
-
WebClient.updateSSLOptions(ClientSSLOptions, boolean)
-
updateSSLOptionsAndForget
public WebClient updateSSLOptionsAndForget(io.vertx.core.net.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
optionsobject is compared using itsequalsmethod 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, settingforcetotrueforces the update.The boolean succeeded underlying uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method ignores the
Booleanresult or any failure.- Parameters:
options- the new SSL optionsforce- force the update when options are equals- Returns:
- The current instance to chain operations if needed.
- See Also:
-
WebClient.updateSSLOptions(ClientSSLOptions, boolean)
-
create
Create a web client using the providedvertxinstance and default options.- Parameters:
vertx- the vertx instance- Returns:
- the created web client
-
create
Create a web client using the providedvertxinstance and default pooling options.- Parameters:
vertx- the vertx instanceoptions- the Web Client options- Returns:
- the created web client
-
create
public static WebClient create(Vertx vertx, io.vertx.ext.web.client.WebClientOptions options, io.vertx.core.http.PoolOptions poolOptions) Create a web client using the providedvertxinstance.- Parameters:
vertx- the vertx instanceoptions- the Web Client optionspoolOptions- the HTTP Client pool options- Returns:
- the created web client
-
create
Create a web client using the providedvertxinstance and default pooling options.- Parameters:
vertx- the vertx instanceconfig- the Web Client config- Returns:
- the created web client
-
create
public static WebClient create(Vertx vertx, io.vertx.ext.web.client.WebClientConfig config, io.vertx.core.http.PoolOptions poolOptions) Create a web client using the providedvertxinstance.- Parameters:
vertx- the vertx instanceconfig- the Web Client configpoolOptions- the HTTP Client pool options- Returns:
- the created web client
-
create
public static WebClient create(Vertx vertx, io.vertx.ext.web.client.WebClientConfig config, io.vertx.core.net.ClientSSLOptions sslOptions) Create a web client using the providedvertxinstance, SSL options and default pooling options.- Parameters:
vertx- the vertx instancesslOptions- the SSL optionsconfig- the Web Client config- Returns:
- the created web client
-
create
public static WebClient create(Vertx vertx, io.vertx.ext.web.client.WebClientConfig config, io.vertx.core.net.ClientSSLOptions sslOptions, io.vertx.core.http.PoolOptions poolOptions) Create a web client using the providedvertxinstance and SSL options.- Parameters:
vertx- the vertx instanceconfig- the Web Client configsslOptions- the SSL optionspoolOptions- the HTTP Client pool options- Returns:
- the created web client
-
wrap
Wrap anhttpClientwith a web client and default options.- Parameters:
httpClient- theHttpClientto wrap- Returns:
- the web client
-
wrap
public static WebClient wrap(HttpClient httpClient, io.vertx.ext.web.client.WebClientOptions options) Wrap anhttpClientwith a web client and default options.Only the specific web client portion of the
optionsis used, theio.vertx.mutiny.core.http.HttpClientOptionsof thehttpClientis reused.- Parameters:
httpClient- theHttpClientto wrapoptions- the Web Client options- Returns:
- the web client
-
request
public 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.- Parameters:
method- the HTTP methodport- the porthost- the hostrequestURI- the request URI- Returns:
- an HTTP client request object
-
request
public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.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
public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, int port, String host, String requestURI) Likerequest(HttpMethod, int, String, String)using theserverAddressparameter to connect to the server instead of theportandhostparameters.The request host header will still be created from the
portandhostparameters.Use
SocketAddress.domainSocketAddress(String)to connect to a unix domain socket server. -
request
public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, int port, String host, UriTemplate requestURI) Likerequest(HttpMethod, int, String, UriTemplate)using theserverAddressparameter to connect to the server instead of theportandhostparameters.The request host header will still be created from the
portandhostparameters.Use
SocketAddress.domainSocketAddress(String)to connect to a unix domain socket server. -
request
public 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.- Parameters:
method- the HTTP methodhost- the hostrequestURI- the request URI- Returns:
- an HTTP client request object
-
request
public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.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
public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String host, String requestURI) Likerequest(HttpMethod, String, String)using theserverAddressparameter to connect to the server instead of the default port andhostparameter.The request host header will still be created from the default port and
hostparameter.Use
SocketAddress.domainSocketAddress(String)to connect to a unix domain socket server. -
request
public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String host, UriTemplate requestURI) Likerequest(HttpMethod, String, UriTemplate)using theserverAddressparameter to connect to the server instead of the default port andhostparameter.The request host header will still be created from the default port and
hostparameter.Use
SocketAddress.domainSocketAddress(String)to connect to a unix domain socket server. -
request
public 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.- Parameters:
method- the HTTP methodrequestURI- the request URI- Returns:
- an HTTP client request object
-
request
public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.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
public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String requestURI) Likerequest(HttpMethod, String)using theserverAddressparameter 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
public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, UriTemplate requestURI) Likerequest(HttpMethod, UriTemplate)using theserverAddressparameter 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
Create an HTTP request to send to the server from the specified requestoptions.- Parameters:
options- the request options- Returns:
- an HTTP client request object
-
request
@Deprecated public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.http.RequestOptions options) Deprecated.instead userequest(RequestOptions)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
@Deprecated public HttpRequest<io.vertx.core.buffer.Buffer> request(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, io.vertx.core.http.RequestOptions options) Deprecated.instead userequest(RequestOptions)Likerequest(HttpMethod, RequestOptions)using theserverAddressparameter to connect to the server instead of theoptionsparameter.The request host header will still be created from the
optionsparameter.Use
SocketAddress.domainSocketAddress(String)to connect to a unix domain socket server. -
requestAbs
public 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- Parameters:
method- the HTTP methodabsoluteURI- the absolute URI- Returns:
- an HTTP client request object
-
requestAbs
public HttpRequest<io.vertx.core.buffer.Buffer> requestAbs(io.vertx.core.http.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
public HttpRequest<io.vertx.core.buffer.Buffer> requestAbs(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, String absoluteURI) LikerequestAbs(HttpMethod, String)using theserverAddressparameter to connect to the server instead of theabsoluteURIparameter.The request host header will still be created from the
absoluteURIparameter.Use
SocketAddress.domainSocketAddress(String)to connect to a unix domain socket server. -
requestAbs
public HttpRequest<io.vertx.core.buffer.Buffer> requestAbs(io.vertx.core.http.HttpMethod method, io.vertx.core.net.SocketAddress serverAddress, UriTemplate absoluteURI) LikerequestAbs(HttpMethod, UriTemplate)using theserverAddressparameter to connect to the server instead of theabsoluteURIparameter.The request host header will still be created from the
absoluteURIparameter.Use
SocketAddress.domainSocketAddress(String)to connect to a unix domain socket server. -
get
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
public HttpRequest<io.vertx.core.buffer.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
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
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
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
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
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
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
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
public HttpRequest<io.vertx.core.buffer.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
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
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
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
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
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
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
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
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
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
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
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
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
-
close
public void close()Close the client. Closing will close down any pooled connections. Clients should always be closed after use. -
newInstance
Creates a new instance of theWebClient. -
hashCode
public int hashCode() -
equals
-
toString
-
request(RequestOptions)