Class: VertxWebClient::WebClient
- Inherits:
-
Object
- Object
- VertxWebClient::WebClient
- Defined in:
- /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb
Overview
An asynchronous HTTP / HTTP/2 client called
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 , 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.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
-
+ (::VertxWebClient::WebClient) create(vertx = nil)
Create a web client using the provided vertx instance.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
-
+ (::VertxWebClient::WebClient) wrap(httpClient = nil)
Wrap an httpClient with a web client.
Instance Method Summary (collapse)
-
- (void) close
Close the client.
-
- (::VertxWebClient::HttpRequest) delete(param_1 = nil, param_2 = nil, param_3 = nil)
Create an HTTP DELETE request to send to the server at the specified host and port.
-
- (::VertxWebClient::HttpRequest) delete_abs(absoluteURI = nil)
Create an HTTP DELETE request to send to the server using an absolute URI, specifying a response handler to receive the response.
-
- (::VertxWebClient::HttpRequest) get(param_1 = nil, param_2 = nil, param_3 = nil)
Create an HTTP GET request to send to the server at the specified host and port.
-
- (::VertxWebClient::HttpRequest) get_abs(absoluteURI = nil)
Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive the response.
-
- (::VertxWebClient::HttpRequest) head(param_1 = nil, param_2 = nil, param_3 = nil)
Create an HTTP HEAD request to send to the server at the specified host and port.
-
- (::VertxWebClient::HttpRequest) head_abs(absoluteURI = nil)
Create an HTTP HEAD request to send to the server using an absolute URI, specifying a response handler to receive the response.
-
- (::VertxWebClient::HttpRequest) patch(param_1 = nil, param_2 = nil, param_3 = nil)
Create an HTTP PATCH request to send to the server at the specified host and port.
-
- (::VertxWebClient::HttpRequest) patch_abs(absoluteURI = nil)
Create an HTTP PATCH request to send to the server using an absolute URI, specifying a response handler to receive the response.
-
- (::VertxWebClient::HttpRequest) post(param_1 = nil, param_2 = nil, param_3 = nil)
Create an HTTP POST request to send to the server at the specified host and port.
-
- (::VertxWebClient::HttpRequest) post_abs(absoluteURI = nil)
Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive the response.
-
- (::VertxWebClient::HttpRequest) put(param_1 = nil, param_2 = nil, param_3 = nil)
Create an HTTP PUT request to send to the server at the specified host and port.
-
- (::VertxWebClient::HttpRequest) put_abs(absoluteURI = nil)
Create an HTTP PUT request to send to the server using an absolute URI, specifying a response handler to receive the response.
-
- (::VertxWebClient::HttpRequest) request(param_1 = nil, param_2 = nil, param_3 = nil, param_4 = nil)
Create an HTTP request to send to the server at the specified host and port.
-
- (::VertxWebClient::HttpRequest) request_abs(method = nil, absoluteURI = nil)
Create an HTTP request to send to the server using an absolute URI.
Class Method Details
+ (Boolean) accept?(obj)
33 34 35 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 33 def @@j_api_type.accept?(obj) obj.class == WebClient end |
+ (::VertxWebClient::WebClient) create(vertx = nil)
Create a web client using the provided
vertx
instance.
51 52 53 54 55 56 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 51 def self.create(vertx=nil) if vertx.class.method_defined?(:j_del) && !block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClient::WebClient.java_method(:create, [Java::IoVertxCore::Vertx.java_class]).call(vertx.j_del),::VertxWebClient::WebClient) end raise ArgumentError, "Invalid arguments when calling create(#{vertx})" end |
+ (Object) j_api_type
42 43 44 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 42 def self.j_api_type @@j_api_type end |
+ (Object) j_class
45 46 47 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 45 def self.j_class Java::IoVertxExtWebClient::WebClient.java_class end |
+ (Object) unwrap(obj)
39 40 41 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 39 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (::VertxWebClient::WebClient) wrap(httpClient = nil)
Wrap an
httpClient
with a web client.
60 61 62 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 60 def @@j_api_type.wrap(obj) WebClient.new(obj) end |
Instance Method Details
- (void) close
This method returns an undefined value.
Close the client. Closing will close down any pooled connections. Clients should always be closed after use.
289 290 291 292 293 294 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 289 def close if !block_given? return @j_del.java_method(:close, []).call() end raise ArgumentError, "Invalid arguments when calling close()" end |
- (::VertxWebClient::HttpRequest) delete(requestURI) - (::VertxWebClient::HttpRequest) delete(host, requestURI) - (::VertxWebClient::HttpRequest) delete(port, host, requestURI)
Create an HTTP DELETE request to send to the server at the specified host and port.
204 205 206 207 208 209 210 211 212 213 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 204 def delete(param_1=nil,param_2=nil,param_3=nil) if param_1.class == String && !block_given? && param_2 == nil && param_3 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:delete, [Java::java.lang.String.java_class]).call(param_1),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == String && param_2.class == String && !block_given? && param_3 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:delete, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == Fixnum && param_2.class == String && param_3.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:delete, [Java::int.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2,param_3),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling delete(#{param_1},#{param_2},#{param_3})" end |
- (::VertxWebClient::HttpRequest) delete_abs(absoluteURI = nil)
Create an HTTP DELETE request to send to the server using an absolute URI, specifying a response handler to receive
the response
218 219 220 221 222 223 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 218 def delete_abs(absoluteURI=nil) if absoluteURI.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:deleteAbs, [Java::java.lang.String.java_class]).call(absoluteURI),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling delete_abs(#{absoluteURI})" end |
- (::VertxWebClient::HttpRequest) get(requestURI) - (::VertxWebClient::HttpRequest) get(host, requestURI) - (::VertxWebClient::HttpRequest) get(port, host, requestURI)
Create an HTTP GET request to send to the server at the specified host and port.
111 112 113 114 115 116 117 118 119 120 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 111 def get(param_1=nil,param_2=nil,param_3=nil) if param_1.class == String && !block_given? && param_2 == nil && param_3 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:get, [Java::java.lang.String.java_class]).call(param_1),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == String && param_2.class == String && !block_given? && param_3 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:get, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == Fixnum && param_2.class == String && param_3.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:get, [Java::int.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2,param_3),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling get(#{param_1},#{param_2},#{param_3})" end |
- (::VertxWebClient::HttpRequest) get_abs(absoluteURI = nil)
Create an HTTP GET request to send to the server using an absolute URI, specifying a response handler to receive
the response
125 126 127 128 129 130 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 125 def get_abs(absoluteURI=nil) if absoluteURI.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getAbs, [Java::java.lang.String.java_class]).call(absoluteURI),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling get_abs(#{absoluteURI})" end |
- (::VertxWebClient::HttpRequest) head(requestURI) - (::VertxWebClient::HttpRequest) head(host, requestURI) - (::VertxWebClient::HttpRequest) head(port, host, requestURI)
Create an HTTP HEAD request to send to the server at the specified host and port.
266 267 268 269 270 271 272 273 274 275 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 266 def head(param_1=nil,param_2=nil,param_3=nil) if param_1.class == String && !block_given? && param_2 == nil && param_3 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:head, [Java::java.lang.String.java_class]).call(param_1),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == String && param_2.class == String && !block_given? && param_3 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:head, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == Fixnum && param_2.class == String && param_3.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:head, [Java::int.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2,param_3),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling head(#{param_1},#{param_2},#{param_3})" end |
- (::VertxWebClient::HttpRequest) head_abs(absoluteURI = nil)
Create an HTTP HEAD request to send to the server using an absolute URI, specifying a response handler to receive
the response
280 281 282 283 284 285 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 280 def head_abs(absoluteURI=nil) if absoluteURI.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:headAbs, [Java::java.lang.String.java_class]).call(absoluteURI),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling head_abs(#{absoluteURI})" end |
- (::VertxWebClient::HttpRequest) patch(requestURI) - (::VertxWebClient::HttpRequest) patch(host, requestURI) - (::VertxWebClient::HttpRequest) patch(port, host, requestURI)
Create an HTTP PATCH request to send to the server at the specified host and port.
235 236 237 238 239 240 241 242 243 244 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 235 def patch(param_1=nil,param_2=nil,param_3=nil) if param_1.class == String && !block_given? && param_2 == nil && param_3 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:patch, [Java::java.lang.String.java_class]).call(param_1),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == String && param_2.class == String && !block_given? && param_3 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:patch, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == Fixnum && param_2.class == String && param_3.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:patch, [Java::int.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2,param_3),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling patch(#{param_1},#{param_2},#{param_3})" end |
- (::VertxWebClient::HttpRequest) patch_abs(absoluteURI = nil)
Create an HTTP PATCH request to send to the server using an absolute URI, specifying a response handler to receive
the response
249 250 251 252 253 254 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 249 def patch_abs(absoluteURI=nil) if absoluteURI.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:patchAbs, [Java::java.lang.String.java_class]).call(absoluteURI),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling patch_abs(#{absoluteURI})" end |
- (::VertxWebClient::HttpRequest) post(requestURI) - (::VertxWebClient::HttpRequest) post(host, requestURI) - (::VertxWebClient::HttpRequest) post(port, host, requestURI)
Create an HTTP POST request to send to the server at the specified host and port.
142 143 144 145 146 147 148 149 150 151 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 142 def post(param_1=nil,param_2=nil,param_3=nil) if param_1.class == String && !block_given? && param_2 == nil && param_3 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:post, [Java::java.lang.String.java_class]).call(param_1),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == String && param_2.class == String && !block_given? && param_3 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:post, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == Fixnum && param_2.class == String && param_3.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:post, [Java::int.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2,param_3),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling post(#{param_1},#{param_2},#{param_3})" end |
- (::VertxWebClient::HttpRequest) post_abs(absoluteURI = nil)
Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive
the response
156 157 158 159 160 161 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 156 def post_abs(absoluteURI=nil) if absoluteURI.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:postAbs, [Java::java.lang.String.java_class]).call(absoluteURI),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling post_abs(#{absoluteURI})" end |
- (::VertxWebClient::HttpRequest) put(requestURI) - (::VertxWebClient::HttpRequest) put(host, requestURI) - (::VertxWebClient::HttpRequest) put(port, host, requestURI)
Create an HTTP PUT request to send to the server at the specified host and port.
173 174 175 176 177 178 179 180 181 182 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 173 def put(param_1=nil,param_2=nil,param_3=nil) if param_1.class == String && !block_given? && param_2 == nil && param_3 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:put, [Java::java.lang.String.java_class]).call(param_1),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == String && param_2.class == String && !block_given? && param_3 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:put, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == Fixnum && param_2.class == String && param_3.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:put, [Java::int.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2,param_3),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling put(#{param_1},#{param_2},#{param_3})" end |
- (::VertxWebClient::HttpRequest) put_abs(absoluteURI = nil)
Create an HTTP PUT request to send to the server using an absolute URI, specifying a response handler to receive
the response
187 188 189 190 191 192 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 187 def put_abs(absoluteURI=nil) if absoluteURI.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:putAbs, [Java::java.lang.String.java_class]).call(absoluteURI),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling put_abs(#{absoluteURI})" end |
- (::VertxWebClient::HttpRequest) request(method, requestURI) - (::VertxWebClient::HttpRequest) request(method, host, requestURI) - (::VertxWebClient::HttpRequest) request(method, port, host, requestURI)
Create an HTTP request to send to the server at the specified host and port.
80 81 82 83 84 85 86 87 88 89 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 80 def request(param_1=nil,param_2=nil,param_3=nil,param_4=nil) if param_1.class == Symbol && param_2.class == String && !block_given? && param_3 == nil && param_4 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:request, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(param_1.to_s),param_2),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == Symbol && param_2.class == String && param_3.class == String && !block_given? && param_4 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:request, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(param_1.to_s),param_2,param_3),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) elsif param_1.class == Symbol && param_2.class == Fixnum && param_3.class == String && param_4.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:request, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::int.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(param_1.to_s),param_2,param_3,param_4),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling request(#{param_1},#{param_2},#{param_3},#{param_4})" end |
- (::VertxWebClient::HttpRequest) request_abs(method = nil, absoluteURI = nil)
Create an HTTP request to send to the server using an absolute URI
94 95 96 97 98 99 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web-client/web_client.rb', line 94 def request_abs(method=nil,absoluteURI=nil) if method.class == Symbol && absoluteURI.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:requestAbs, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(method.to_s),absoluteURI),::VertxWebClient::HttpRequest,::Vertx::Buffer.j_api_type) end raise ArgumentError, "Invalid arguments when calling request_abs(#{method},#{absoluteURI})" end |