Class: Vertx::HttpClientRequest
- Inherits:
-
Future
- Object
- Future
- Vertx::HttpClientRequest
- Includes:
- WriteStream
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb
Overview
Instances are created by an HttpClient instance, via one of the methods corresponding to the specific HTTP methods, or the generic request methods. On creation the request will not have been written to the wire.
Once a request has been obtained, headers can be set on it, and data can be written to its body if required. Once you are ready to send the request, one of the #end methods should be called.
Nothing is actually sent until the request has been internally assigned an HTTP connection.
The HttpClient instance will return an instance of this class immediately, even if there are no HTTP connections available in the pool. Any requests sent before a connection is assigned will be queued internally and actually sent when an HTTP connection becomes available from the pool.
The headers of the request are queued for writing either when the #end method is called, or, when the first part of the body is written, whichever occurs first.
This class supports both chunked and non-chunked HTTP.
It implements WriteStream so it can be used with Pump to pump data with flow control.
An example of using this class is as follows:
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (String) absolute_uri
The absolute URI corresponding to the the HTTP request.
-
- (Exception) cause
A Throwable describing failure.
-
- (true, false) chunked?
Is the request chunked?.
-
- (true, false) complete?
Has the future completed? It's completed if it's either succeeded or failed.
-
- (::Vertx::Future) compose(mapper = nil) { ... }
Compose this future with a mapper function.
-
- (::Vertx::HttpConnection) connection
The HttpConnection associated with this request.
-
- (self) connection_handler { ... }
Set a connection handler called when an HTTP connection has been established.
-
- (self) continue_handler { ... }
If you send an HTTP request with the header Expect set to the value 100-continue and the server responds with an interim HTTP response with a status code of 100 and a continue handler has been set using this method, then the handler will be called.
- - (self) drain_handler { ... }
-
- (void) end(param_1 = nil, param_2 = nil)
Same as #end but with an handler called when the operation completes.
- - (self) exception_handler { ... }
-
- (true, false) failed?
Did it fail?.
-
- (Proc) get_handler
The handler for the result.
-
- (String) get_host
The request host.
-
- (String) get_raw_method
The raw value of the method this request sends.
-
- (Hash{String => Object}) get_stream_priority
The priority of the associated HTTP/2 stream for HTTP/2 otherwise null.
-
- (::Vertx::MultiMap) headers
The HTTP headers.
-
- (::Vertx::Future) map(param_1 = nil)
Map the result of a future to a specific value.
-
- (::Vertx::Future) map_empty
Map the result of a future to null.
-
- (:OPTIONS, ...) method
The HTTP method for the request.
-
- (::Vertx::Future) otherwise(param_1 = nil)
Map the failure of a future to a specific value.
-
- (::Vertx::Future) otherwise_empty
Map the failure of a future to null.
-
- (String) path
The path part of the uri.
-
- (self) push_handler { ... }
Set a push handler for this request.
-
- (self) put_header(name = nil, value = nil)
Put an HTTP header.
-
- (String) query
The query part of the uri.
-
- (::Vertx::Future) recover(mapper = nil) { ... }
Handles a failure of this Future by returning the result of another Future.
-
- (true, false) reset?(code = nil)
Reset this request: for HTTP/2, this performs send an HTTP/2 reset frame with the specified error code for HTTP/1.x, this closes the connection when the current request is inflight When the request has not yet been sent, the request will be aborted and false is returned as indicator.
-
- (::Vertx::HttpClientResponse) result
The result of the operation.
-
- (self) send_head { ... }
Like #send_head but with an handler after headers have been sent.
-
- (self) set_chunked(chunked = nil)
If chunked is true then the request will be set into HTTP chunked mode.
-
- (self) set_follow_redirects(followRedirects = nil)
Set the request to follow HTTP redirects up to => Object#get_max_redirects}.
- - (self) set_handler { ... }
-
- (self) set_host(host = nil)
Set the request host.
-
- (self) set_max_redirects(maxRedirects = nil)
Set the max number of HTTP redirects this request will follow.
-
- (self) set_raw_method(method = nil)
Set the value the method to send when the method is used.
-
- (self) set_stream_priority(streamPriority = nil)
Sets the priority of the associated stream.
-
- (self) set_timeout(timeoutMs = nil)
Set's the amount of time after which if the request does not return any data within the timeout period an TimeoutException will be passed to the exception handler (if provided) and the request will be closed.
- - (self) set_write_queue_max_size(maxSize = nil)
-
- (Fixnum) stream_id
The id of the stream of this response, when it is not yet determined, i.e the request has not been yet sent or it is not supported HTTP/1.x.
-
- (true, false) succeeded?
Did it succeed?.
-
- (String) uri
The URI of the request.
-
- (void) write(param_1 = nil, param_2 = nil)
Same as #write but with an handler called when the operation completes.
-
- (self) write_custom_frame(param_1 = nil, param_2 = nil, param_3 = nil)
Write an HTTP/2 frame to the request, allowing to extend the HTTP/2 protocol.
-
- (true, false) write_queue_full?
This will return true if there are more bytes in the write queue than the value set using #set_write_queue_max_size.
Methods inherited from Future
failed_future, future, succeeded_future
Class Method Details
+ (Boolean) accept?(obj)
50 51 52 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 50 def @@j_api_type.accept?(obj) obj.class == HttpClientRequest end |
+ (Object) j_api_type
59 60 61 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 59 def self.j_api_type @@j_api_type end |
+ (Object) j_class
62 63 64 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 62 def self.j_class Java::IoVertxCoreHttp::HttpClientRequest.java_class end |
+ (Object) unwrap(obj)
56 57 58 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 56 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
53 54 55 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 53 def @@j_api_type.wrap(obj) HttpClientRequest.new(obj) end |
Instance Method Details
- (String) absolute_uri
327 328 329 330 331 332 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 327 def absolute_uri if !block_given? return @j_del.java_method(:absoluteURI, []).call() end raise ArgumentError, "Invalid arguments when calling absolute_uri()" end |
- (Exception) cause
122 123 124 125 126 127 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 122 def cause if !block_given? return ::Vertx::Util::Utils.from_throwable(@j_del.java_method(:cause, []).call()) end raise ArgumentError, "Invalid arguments when calling cause()" end |
- (true, false) chunked?
295 296 297 298 299 300 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 295 def chunked? if !block_given? return @j_del.java_method(:isChunked, []).call() end raise ArgumentError, "Invalid arguments when calling chunked?()" end |
- (true, false) complete?
It's completed if it's either succeeded or failed.
99 100 101 102 103 104 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 99 def complete? if !block_given? return @j_del.java_method(:isComplete, []).call() end raise ArgumentError, "Invalid arguments when calling complete?()" end |
- (::Vertx::Future) compose(mapper = nil) { ... }
mapper function.
When this future (the one on which compose is called) succeeds, the mapper will be called with
the completed value and this mapper returns another future object. This returned future completion will complete
the future returned by this method call.
If the mapper throws an exception, the returned future will be failed with this exception.
When this future fails, the failure will be propagated to the returned future and the mapper
will not be called.
156 157 158 159 160 161 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 156 def compose(mapper=nil) if block_given? && mapper == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:compose, [Java::JavaUtilFunction::Function.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::Vertx::HttpClientResponse)).j_del unless !block_given? })),::Vertx::Future, nil) end raise ArgumentError, "Invalid arguments when calling compose(#{mapper})" end |
- (::Vertx::HttpConnection) connection
509 510 511 512 513 514 515 516 517 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 509 def connection if !block_given? if @cached_connection != nil return @cached_connection end return @cached_connection = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:connection, []).call(),::Vertx::HttpConnection) end raise ArgumentError, "Invalid arguments when calling connection()" end |
- (self) connection_handler { ... }
521 522 523 524 525 526 527 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 521 def connection_handler if true @j_del.java_method(:connectionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::Vertx::HttpConnection)) unless !block_given? })) return self end raise ArgumentError, "Invalid arguments when calling connection_handler()" end |
- (self) continue_handler { ... }
Expect set to the value 100-continue
and the server responds with an interim HTTP response with a status code of 100 and a continue handler
has been set using this method, then the handler will be called.
You can then continue to write data to the request body and later end it. This is normally used in conjunction with the #send_head method to force the request header to be written before the request has ended.
402 403 404 405 406 407 408 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 402 def continue_handler if true @j_del.java_method(:continueHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield unless !block_given? }) return self end raise ArgumentError, "Invalid arguments when calling continue_handler()" end |
- (self) drain_handler { ... }
256 257 258 259 260 261 262 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 256 def drain_handler if true @j_del.java_method(:drainHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield unless !block_given? }) return self end raise ArgumentError, "Invalid arguments when calling drain_handler()" end |
- (void) end(handler) { ... } - (void) end(chunk, handler) { ... } - (void) end(chunk, handler) { ... } - (void) end(chunk, enc, handler) { ... }
This method returns an undefined value.
Same as #end but with anhandler called when the operation completes
437 438 439 440 441 442 443 444 445 446 447 448 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 437 def end(param_1=nil,param_2=nil) if true && param_1 == nil && param_2 == nil return @j_del.java_method(:end, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) elsif param_1.class == String && true && param_2 == nil return @j_del.java_method(:end, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) elsif param_1.class.method_defined?(:j_del) && true && param_2 == nil return @j_del.java_method(:end, [Java::IoVertxCoreBuffer::Buffer.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1.j_del,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) elsif param_1.class == String && param_2.class == String && true return @j_del.java_method(:end, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1,param_2,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling end(#{param_1},#{param_2})" end |
- (self) exception_handler { ... }
238 239 240 241 242 243 244 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 238 def exception_handler if true @j_del.java_method(:exceptionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) unless !block_given? })) return self end raise ArgumentError, "Invalid arguments when calling exception_handler()" end |
- (true, false) failed?
138 139 140 141 142 143 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 138 def failed? if !block_given? return @j_del.java_method(:failed, []).call() end raise ArgumentError, "Invalid arguments when calling failed?()" end |
- (Proc) get_handler
106 107 108 109 110 111 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 106 def get_handler if !block_given? return ::Vertx::Util::Utils.to_async_result_handler_proc(@j_del.java_method(:getHandler, []).call()) { |val| val.j_del } end raise ArgumentError, "Invalid arguments when calling get_handler()" end |
- (String) get_host
367 368 369 370 371 372 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 367 def get_host if !block_given? return @j_del.java_method(:getHost, []).call() end raise ArgumentError, "Invalid arguments when calling get_host()" end |
- (String) get_raw_method
310 311 312 313 314 315 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 310 def get_raw_method if !block_given? return @j_del.java_method(:getRawMethod, []).call() end raise ArgumentError, "Invalid arguments when calling get_raw_method()" end |
- (Hash{String => Object}) get_stream_priority
null
571 572 573 574 575 576 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 571 def get_stream_priority if !block_given? return @j_del.java_method(:getStreamPriority, []).call() != nil ? JSON.parse(@j_del.java_method(:getStreamPriority, []).call().toJson.encode) : nil end raise ArgumentError, "Invalid arguments when calling get_stream_priority()" end |
- (::Vertx::MultiMap) headers
374 375 376 377 378 379 380 381 382 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 374 def headers if !block_given? if @cached_headers != nil return @cached_headers end return @cached_headers = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:headers, []).call(),::Vertx::MultiMap) end raise ArgumentError, "Invalid arguments when calling headers()" end |
- (::Vertx::Future) map(mapper) { ... } - (::Vertx::Future) map(value)
value.
When this future succeeds, this value will complete the future returned by this method call.
When this future fails, the failure will be propagated to the returned future.
172 173 174 175 176 177 178 179 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 172 def map(param_1=nil) if block_given? && param_1 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:map, [Java::JavaUtilFunction::Function.java_class]).call((Proc.new { |event| ::Vertx::Util::Utils.to_object(yield(::Vertx::Util::Utils.safe_create(event,::Vertx::HttpClientResponse))) unless !block_given? })),::Vertx::Future, nil) elsif ::Vertx::Util::unknown_type.accept?(param_1) && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:map, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(param_1)),::Vertx::Future, nil) end raise ArgumentError, "Invalid arguments when calling map(#{param_1})" end |
- (::Vertx::Future) map_empty
null.
This is a conveniency for future.map((T) null) or future.map((Void) null).
When this future succeeds, null will complete the future returned by this method call.
When this future fails, the failure will be propagated to the returned future.
188 189 190 191 192 193 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 188 def map_empty if !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:mapEmpty, []).call(),::Vertx::Future, nil) end raise ArgumentError, "Invalid arguments when calling map_empty()" end |
- (:OPTIONS, ...) method
303 304 305 306 307 308 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 303 def method if !block_given? return @j_del.java_method(:method, []).call().name.intern end raise ArgumentError, "Invalid arguments when calling method()" end |
- (::Vertx::Future) otherwise(mapper) { ... } - (::Vertx::Future) otherwise(value)
value.
When this future fails, this value will complete the future returned by this method call.
When this future succeeds, the result will be propagated to the returned future.
214 215 216 217 218 219 220 221 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 214 def otherwise(param_1=nil) if block_given? && param_1 == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:otherwise, [Java::JavaUtilFunction::Function.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)).j_del unless !block_given? })),::Vertx::Future,::Vertx::HttpClientResponse.j_api_type) elsif param_1.class.method_defined?(:j_del) && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:otherwise, [Java::IoVertxCoreHttp::HttpClientResponse.java_class]).call(param_1.j_del),::Vertx::Future,::Vertx::HttpClientResponse.j_api_type) end raise ArgumentError, "Invalid arguments when calling otherwise(#{param_1})" end |
- (::Vertx::Future) otherwise_empty
null.
This is a convenience for future.otherwise((T) null).
When this future fails, the null value will complete the future returned by this method call.
When this future succeeds, the result will be propagated to the returned future.
230 231 232 233 234 235 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 230 def otherwise_empty if !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:otherwiseEmpty, []).call(),::Vertx::Future,::Vertx::HttpClientResponse.j_api_type) end raise ArgumentError, "Invalid arguments when calling otherwise_empty()" end |
- (String) path
341 342 343 344 345 346 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 341 def path if !block_given? return @j_del.java_method(:path, []).call() end raise ArgumentError, "Invalid arguments when calling path()" end |
- (self) push_handler { ... }
482 483 484 485 486 487 488 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 482 def push_handler if true @j_del.java_method(:pushHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::Vertx::HttpClientRequest)) unless !block_given? })) return self end raise ArgumentError, "Invalid arguments when calling push_handler()" end |
- (self) put_header(name = nil, value = nil)
387 388 389 390 391 392 393 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 387 def put_header(name=nil,value=nil) if name.class == String && value.class == String && !block_given? @j_del.java_method(:putHeader, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(name,value) return self end raise ArgumentError, "Invalid arguments when calling put_header(#{name},#{value})" end |
- (String) query
348 349 350 351 352 353 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 348 def query if !block_given? return @j_del.java_method(:query, []).call() end raise ArgumentError, "Invalid arguments when calling query()" end |
- (::Vertx::Future) recover(mapper = nil) { ... }
198 199 200 201 202 203 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 198 def recover(mapper=nil) if block_given? && mapper == nil return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:recover, [Java::JavaUtilFunction::Function.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)).j_del unless !block_given? })),::Vertx::Future,::Vertx::HttpClientResponse.j_api_type) end raise ArgumentError, "Invalid arguments when calling recover(#{mapper})" end |
- (true, false) reset?(code = nil)
- for HTTP/2, this performs send an HTTP/2 reset frame with the specified error
code - for HTTP/1.x, this closes the connection when the current request is inflight
500 501 502 503 504 505 506 507 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 500 def reset?(code=nil) if !block_given? && code == nil return @j_del.java_method(:reset, []).call() elsif code.class == Fixnum && !block_given? return @j_del.java_method(:reset, [Java::long.java_class]).call(code) end raise ArgumentError, "Invalid arguments when calling reset?(#{code})" end |
- (::Vertx::HttpClientResponse) result
114 115 116 117 118 119 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 114 def result if !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:result, []).call(),::Vertx::HttpClientResponse) end raise ArgumentError, "Invalid arguments when calling result()" end |
- (self) send_head { ... }
413 414 415 416 417 418 419 420 421 422 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 413 def send_head if !block_given? @j_del.java_method(:sendHead, []).call() return self elsif true @j_del.java_method(:sendHead, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event.name.intern) unless !block_given? })) return self end raise ArgumentError, "Invalid arguments when calling send_head()" end |
- (self) set_chunked(chunked = nil)
287 288 289 290 291 292 293 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 287 def set_chunked(chunked=nil) if (chunked.class == TrueClass || chunked.class == FalseClass) && !block_given? @j_del.java_method(:setChunked, [Java::boolean.java_class]).call(chunked) return self end raise ArgumentError, "Invalid arguments when calling set_chunked(#{chunked})" end |
- (self) set_follow_redirects(followRedirects = nil)
266 267 268 269 270 271 272 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 266 def set_follow_redirects(followRedirects=nil) if (followRedirects.class == TrueClass || followRedirects.class == FalseClass) && !block_given? @j_del.java_method(:setFollowRedirects, [Java::boolean.java_class]).call(followRedirects) return self end raise ArgumentError, "Invalid arguments when calling set_follow_redirects(#{followRedirects})" end |
- (self) set_handler { ... }
579 580 581 582 583 584 585 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 579 def set_handler if true @j_del.java_method(:setHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::HttpClientResponse) : nil) } unless !block_given?)) return self end raise ArgumentError, "Invalid arguments when calling set_handler()" end |
- (self) set_host(host = nil)
359 360 361 362 363 364 365 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 359 def set_host(host=nil) if host.class == String && !block_given? @j_del.java_method(:setHost, [Java::java.lang.String.java_class]).call(host) return self end raise ArgumentError, "Invalid arguments when calling set_host(#{host})" end |
- (self) set_max_redirects(maxRedirects = nil)
0 which means
no redirects.
277 278 279 280 281 282 283 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 277 def set_max_redirects(maxRedirects=nil) if maxRedirects.class == Fixnum && !block_given? @j_del.java_method(:setMaxRedirects, [Java::int.java_class]).call(maxRedirects) return self end raise ArgumentError, "Invalid arguments when calling set_max_redirects(#{maxRedirects})" end |
- (self) set_raw_method(method = nil)
319 320 321 322 323 324 325 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 319 def set_raw_method(method=nil) if method.class == String && !block_given? @j_del.java_method(:setRawMethod, [Java::java.lang.String.java_class]).call(method) return self end raise ArgumentError, "Invalid arguments when calling set_raw_method(#{method})" end |
- (self) set_stream_priority(streamPriority = nil)
563 564 565 566 567 568 569 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 563 def set_stream_priority(streamPriority=nil) if streamPriority.class == Hash && !block_given? @j_del.java_method(:setStreamPriority, [Java::IoVertxCoreHttp::StreamPriority.java_class]).call(Java::IoVertxCoreHttp::StreamPriority.new(::Vertx::Util::Utils.to_json_object(streamPriority))) return self end raise ArgumentError, "Invalid arguments when calling set_stream_priority(#{streamPriority})" end |
- (self) set_timeout(timeoutMs = nil)
Calling this method more than once has the effect of canceling any existing timeout and starting the timeout from scratch.
457 458 459 460 461 462 463 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 457 def set_timeout(timeoutMs=nil) if timeoutMs.class == Fixnum && !block_given? @j_del.java_method(:setTimeout, [Java::long.java_class]).call(timeoutMs) return self end raise ArgumentError, "Invalid arguments when calling set_timeout(#{timeoutMs})" end |
- (self) set_write_queue_max_size(maxSize = nil)
247 248 249 250 251 252 253 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 247 def set_write_queue_max_size(maxSize=nil) if maxSize.class == Fixnum && !block_given? @j_del.java_method(:setWriteQueueMaxSize, [Java::int.java_class]).call(maxSize) return self end raise ArgumentError, "Invalid arguments when calling set_write_queue_max_size(#{maxSize})" end |
- (Fixnum) stream_id
552 553 554 555 556 557 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 552 def stream_id if !block_given? return @j_del.java_method(:streamId, []).call() end raise ArgumentError, "Invalid arguments when calling stream_id()" end |
- (true, false) succeeded?
130 131 132 133 134 135 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 130 def succeeded? if !block_given? return @j_del.java_method(:succeeded, []).call() end raise ArgumentError, "Invalid arguments when calling succeeded?()" end |
- (String) uri
334 335 336 337 338 339 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 334 def uri if !block_given? return @j_del.java_method(:uri, []).call() end raise ArgumentError, "Invalid arguments when calling uri()" end |
- (void) write(data, handler) { ... } - (void) write(chunk, handler) { ... } - (void) write(chunk, enc, handler) { ... }
This method returns an undefined value.
Same as #write but with anhandler called when the operation completes
77 78 79 80 81 82 83 84 85 86 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 77 def write(param_1=nil,param_2=nil) if param_1.class.method_defined?(:j_del) && true && param_2 == nil return @j_del.java_method(:write, [Java::IoVertxCoreBuffer::Buffer.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1.j_del,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) elsif param_1.class == String && true && param_2 == nil return @j_del.java_method(:write, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) elsif param_1.class == String && param_2.class == String && true return @j_del.java_method(:write, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1,param_2,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling write(#{param_1},#{param_2})" end |
- (self) writeCustomFrame(frame) - (self) writeCustomFrame(type, flags, payload)
The frame is sent immediatly and is not subject to flow control.
This method must be called after the request headers have been sent and only for the protocol HTTP/2. The #send_head should be used for this purpose.
541 542 543 544 545 546 547 548 549 550 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 541 def write_custom_frame(param_1=nil,param_2=nil,param_3=nil) if param_1.class.method_defined?(:j_del) && !block_given? && param_2 == nil && param_3 == nil @j_del.java_method(:writeCustomFrame, [Java::IoVertxCoreHttp::HttpFrame.java_class]).call(param_1.j_del) return self elsif param_1.class == Fixnum && param_2.class == Fixnum && param_3.class.method_defined?(:j_del) && !block_given? @j_del.java_method(:writeCustomFrame, [Java::int.java_class,Java::int.java_class,Java::IoVertxCoreBuffer::Buffer.java_class]).call(param_1,param_2,param_3.j_del) return self end raise ArgumentError, "Invalid arguments when calling write_custom_frame(#{param_1},#{param_2},#{param_3})" end |
- (true, false) write_queue_full?
true if there are more bytes in the write queue than the value set using #set_write_queue_max_size
89 90 91 92 93 94 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_client_request.rb', line 89 def write_queue_full? if !block_given? return @j_del.java_method(:writeQueueFull, []).call() end raise ArgumentError, "Invalid arguments when calling write_queue_full?()" end |