Class: VertxWebClient::HttpRequest

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb

Overview

A client-side HTTP request.

Instances are created by an WebClient instance, via one of the methods corresponding to the specific HTTP methods such as WebClient#get, etc...

The request shall be configured prior sending, the request is immutable and when a mutator method is called, a new request is returned allowing to expose the request in a public API and apply further customization.

After the request has been configured, the methods

can be called. The sendXXX methods perform the actual request, they can be called multiple times to perform the same HTTP request at different points in time.

The handler is called back with

  • an HttpResponse instance when the HTTP response has been received
  • a failure when the HTTP request failed (like a connection error) or when the HTTP response could not be obtained (like connection or unmarshalling errors)

Most of the time, this client will buffer the HTTP response fully unless a specific is used such as .

Instance Method Summary (collapse)

Instance Method Details

- (self) addQueryParam(paramName, paramValue)

Add a query parameter to the request.

Parameters:

  • paramName (String)
    the param name
  • paramValue (String)
    the param value

Returns:

  • (self)


469
470
471
472
473
474
475
476
477
478
479
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 469

def add_query_param(*args)
  if args[0].class == String && args[1].class == String && !block_given?
    @j_del.java_method(:addQueryParam, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(args[0],args[1])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling add_query_param(#{args[0]},#{args[1]})"
  end
end

- (::VertxWebClient::HttpRequest) as(responseCodec)

Configure the request to decode the response with the responseCodec.

Parameters:

Returns:



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-web-client/http_request.rb', line 439

def as(*args)
  if args[0].class.method_defined?(:j_del) && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:as, [Java::IoVertxExtWebCodec::BodyCodec.java_class]).call(args[0].j_del),::VertxWebClient::HttpRequest, nil)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling as(#{args[0]})"
  end
end

- (self) basicAuthentication(id, password) - (self) basicAuthentication(id, password)

Configure the request to perform basic access authentication.

In basic HTTP authentication, a request contains a header field of the form 'Authorization: Basic <credentials>', where credentials is the base64 encoding of id and password joined by a colon.

Overloads:

  • - (self) basicAuthentication(id, password)

    Parameters:

    • id (String)
      the id
    • password (String)
      the password
  • - (self) basicAuthentication(id, password)

    Parameters:

Returns:

  • (self)


381
382
383
384
385
386
387
388
389
390
391
392
393
394
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 381

def basic_authentication(*args)
  if args[0].class == String && args[1].class == String && !block_given?
    @j_del.java_method(:basicAuthentication, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(args[0],args[1])
    return self
  elsif args[0].class.method_defined?(:j_del) && args[1].class.method_defined?(:j_del) && !block_given?
    @j_del.java_method(:basicAuthentication, [Java::IoVertxCoreBuffer::Buffer.java_class,Java::IoVertxCoreBuffer::Buffer.java_class]).call(args[0].j_del,args[1].j_del)
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling basic_authentication(#{args[0]},#{args[1]})"
  end
end

- (self) bearerTokenAuthentication(bearerToken)

Configure the request to perform bearer token authentication.

In OAuth 2.0, a request contains a header field of the form 'Authorization: Bearer <bearerToken>', where bearerToken is the bearer token issued by an authorization server to access protected resources.

Parameters:

  • bearerToken (String)
    the bearer token

Returns:

  • (self)


512
513
514
515
516
517
518
519
520
521
522
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 512

def bearer_token_authentication(*args)
  if args[0].class == String && !block_given?
    @j_del.java_method(:bearerTokenAuthentication, [Java::java.lang.String.java_class]).call(args[0])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling bearer_token_authentication(#{args[0]})"
  end
end

- (::VertxWebClient::HttpRequest) copy

Copy this request

Returns:



276
277
278
279
280
281
282
283
284
285
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 276

def copy
  if !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:copy, []).call(),::VertxWebClient::HttpRequest, nil)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling copy()"
  end
end

- (self) expect(predicate) { ... } - (self) expect(predicate)

Add an expectation that the response is valid according to the provided predicate.

Multiple predicates can be added.

Overloads:

Returns:

  • (self)


421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 421

def expect(*args)
  if block_given? && args[0] == nil
    @j_del.java_method(:expect, [Java::JavaUtilFunction::Function.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxWebClient::HttpResponse, nil)).j_del unless !block_given? }))
    return self
  elsif args[0].class.method_defined?(:j_del) && !block_given?
    @j_del.java_method(:expect, [Java::IoVertxExtWebClientPredicate::ResponsePredicate.java_class]).call(args[0].j_del)
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling expect(#{args[0]})"
  end
end

- (self) followRedirects(value)

Set wether or not to follow the directs for the request.

Parameters:

  • value (true, false)
    true if redirections should be followed

Returns:

  • (self)


247
248
249
250
251
252
253
254
255
256
257
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 247

def follow_redirects(*args)
  if (args[0].class == TrueClass || args[0].class == FalseClass) && !block_given?
    @j_del.java_method(:followRedirects, [Java::boolean.java_class]).call(args[0])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling follow_redirects(#{args[0]})"
  end
end

- (::Vertx::MultiMap) headers

Returns The HTTP headers

Returns:



288
289
290
291
292
293
294
295
296
297
298
299
300
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 288

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
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling headers()"
  end
end

- (self) host(value)

Configure the request to use a new host value.

Parameters:

  • value (String)

Returns:

  • (self)


262
263
264
265
266
267
268
269
270
271
272
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 262

def host(*args)
  if args[0].class == String && !block_given?
    @j_del.java_method(:host, [Java::java.lang.String.java_class]).call(args[0])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling host(#{args[0]})"
  end
end

- (self) method(value)

Configure the request to use a new method value.

Parameters:

  • value (:OPTIONS, :GET, :HEAD, :POST, :PUT, :DELETE, :TRACE, :CONNECT, :PATCH, :OTHER)

Returns:

  • (self)


321
322
323
324
325
326
327
328
329
330
331
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 321

def method(*args)
  if args[0].class == Symbol && !block_given?
    @j_del.java_method(:method, [Java::IoVertxCoreHttp::HttpMethod.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(args[0].to_s))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling method(#{args[0]})"
  end
end

- (::VertxWebClient::HttpRequest) multipartMixed(allow)

Allow or disallow multipart mixed encoding when sending having files sharing the same file name.
The default value is true.
Set to false if you want to achieve the behavior for HTML5.

Parameters:

  • allow (true, false)
    true allows use of multipart mixed encoding

Returns:



106
107
108
109
110
111
112
113
114
115
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 106

def multipart_mixed(*args)
  if (args[0].class == TrueClass || args[0].class == FalseClass) && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:multipartMixed, [Java::boolean.java_class]).call(args[0]),::VertxWebClient::HttpRequest, nil)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling multipart_mixed(#{args[0]})"
  end
end

- (self) port(value)

Configure the request to use a new port value.

Parameters:

  • value (Fixnum)

Returns:

  • (self)


453
454
455
456
457
458
459
460
461
462
463
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 453

def port(*args)
  if args[0].class == Fixnum && !block_given?
    @j_del.java_method(:port, [Java::int.java_class]).call(args[0])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling port(#{args[0]})"
  end
end

- (self) putHeader(name, value)

Configure the request to set a new HTTP header.

Parameters:

  • name (String)
    the header name
  • value (String)
    the header value

Returns:

  • (self)


528
529
530
531
532
533
534
535
536
537
538
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 528

def put_header(*args)
  if args[0].class == String && args[1].class == String && !block_given?
    @j_del.java_method(:putHeader, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(args[0],args[1])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling put_header(#{args[0]},#{args[1]})"
  end
end

- (self) putHeaders(headers)

Configure the request to add multiple HTTP headers .

Parameters:

Returns:

  • (self)


336
337
338
339
340
341
342
343
344
345
346
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 336

def put_headers(*args)
  if args[0].class.method_defined?(:j_del) && !block_given?
    @j_del.java_method(:putHeaders, [Java::IoVertxCore::MultiMap.java_class]).call(args[0].j_del)
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling put_headers(#{args[0]})"
  end
end

- (::Vertx::MultiMap) queryParams

Return the current query parameters.

Returns:



119
120
121
122
123
124
125
126
127
128
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 119

def query_params
  if !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:queryParams, []).call(),::Vertx::MultiMap)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling query_params()"
  end
end

- (self) rawMethod(method)

Configure the request to use a custom HTTP method

Parameters:

  • method (String)

Returns:

  • (self)


232
233
234
235
236
237
238
239
240
241
242
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 232

def raw_method(*args)
  if args[0].class == String && !block_given?
    @j_del.java_method(:rawMethod, [Java::java.lang.String.java_class]).call(args[0])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling raw_method(#{args[0]})"
  end
end

- (void) send(handler) { ... }

This method returns an undefined value.

Send a request, the handler will receive the response as an VertxWebClient::HttpResponse.

Yields:



543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 543

def send
  if true
    if (block_given?)
      return @j_del.java_method(:send, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:send, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxWebClient::HttpResponse.j_api_type)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling send()"
  end
end

- (void) sendBuffer(body, handler) { ... }

This method returns an undefined value.

Like #send but with an HTTP request body buffer.

Parameters:

Yields:



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 156

def send_buffer(*args)
  if args[0].class.method_defined?(:j_del) && true
    if (block_given?)
      return @j_del.java_method(:sendBuffer, [Java::IoVertxCoreBuffer::Buffer.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:sendBuffer, [Java::IoVertxCoreBuffer::Buffer.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxWebClient::HttpResponse.j_api_type)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling send_buffer(#{args[0]})"
  end
end

- (void) sendForm(body, handler) { ... }

This method returns an undefined value.

Like #send but with an HTTP request body multimap encoded as form and the content type set to application/x-www-form-urlencoded.

When the content type header is previously set to multipart/form-data it will be used instead.

Parameters:

Yields:



488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 488

def send_form(*args)
  if args[0].class.method_defined?(:j_del) && true
    if (block_given?)
      return @j_del.java_method(:sendForm, [Java::IoVertxCore::MultiMap.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:sendForm, [Java::IoVertxCore::MultiMap.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxWebClient::HttpResponse.j_api_type)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling send_form(#{args[0]})"
  end
end

- (void) sendJson(body, handler) { ... }

This method returns an undefined value.

Like #send but with an HTTP request body object encoded as json and the content type set to application/json.

Parameters:

  • body (Object)
    the body

Yields:



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 135

def send_json(*args)
  if ::Vertx::Util::unknown_type.accept?(args[0]) && true
    if (block_given?)
      return @j_del.java_method(:sendJson, [Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(::Vertx::Util::Utils.to_object(args[0]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:sendJson, [Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(::Vertx::Util::Utils.to_object(args[0]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxWebClient::HttpResponse.j_api_type)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling send_json(#{args[0]})"
  end
end

- (void) sendJsonObject(body, handler) { ... }

This method returns an undefined value.

Like #send but with an HTTP request body object encoded as json and the content type set to application/json.

Parameters:

  • body (Hash{String => Object})
    the body

Yields:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 81

def send_json_object(*args)
  if args[0].class == Hash && true
    if (block_given?)
      return @j_del.java_method(:sendJsonObject, [Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(::Vertx::Util::Utils.to_json_object(args[0]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:sendJsonObject, [Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(::Vertx::Util::Utils.to_json_object(args[0]),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxWebClient::HttpResponse.j_api_type)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling send_json_object(#{args[0]})"
  end
end

- (void) sendMultipartForm(body, handler) { ... }

This method returns an undefined value.

Like #send but with an HTTP request body multimap encoded as form and the content type set to multipart/form-data. You may use this method to send attributes and upload files.

Parameters:

Yields:



353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 353

def send_multipart_form(*args)
  if args[0].class.method_defined?(:j_del) && true
    if (block_given?)
      return @j_del.java_method(:sendMultipartForm, [Java::IoVertxExtWebMultipart::MultipartForm.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:sendMultipartForm, [Java::IoVertxExtWebMultipart::MultipartForm.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxWebClient::HttpResponse.j_api_type)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling send_multipart_form(#{args[0]})"
  end
end

- (void) sendStream(body, handler) { ... }

This method returns an undefined value.

Like #send but with an HTTP request body stream.

Parameters:

Yields:



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 59

def send_stream(*args)
  if args[0].class.method_defined?(:j_del) && true
    if (block_given?)
      return @j_del.java_method(:sendStream, [Java::IoVertxCoreStreams::ReadStream.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:sendStream, [Java::IoVertxCoreStreams::ReadStream.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxWebClient::HttpResponse, nil) : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxWebClient::HttpResponse.j_api_type)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling send_stream(#{args[0]})"
  end
end

- (self) setQueryParam(paramName, paramValue)

Set a query parameter to the request.

Parameters:

  • paramName (String)
    the param name
  • paramValue (String)
    the param value

Returns:

  • (self)


306
307
308
309
310
311
312
313
314
315
316
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 306

def set_query_param(*args)
  if args[0].class == String && args[1].class == String && !block_given?
    @j_del.java_method(:setQueryParam, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(args[0],args[1])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling set_query_param(#{args[0]},#{args[1]})"
  end
end

- (self) ssl(value)

Parameters:

  • value (true, false)

Returns:

  • (self)


199
200
201
202
203
204
205
206
207
208
209
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 199

def ssl(*args)
  if (args[0].class == TrueClass || args[0].class == FalseClass) && !block_given?
    @j_del.java_method(:ssl, [Java::JavaLang::Boolean.java_class]).call(args[0])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling ssl(#{args[0]})"
  end
end

- (self) timeout(value)

Configures the amount of time in milliseconds after which if the request does not return any data within the timeout period an TimeoutException fails the request.

Setting zero or a negative value disables the timeout.

Parameters:

  • value (Fixnum)
    The quantity of time in milliseconds.

Returns:

  • (self)


217
218
219
220
221
222
223
224
225
226
227
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 217

def timeout(*args)
  if args[0].class == Fixnum && !block_given?
    @j_del.java_method(:timeout, [Java::long.java_class]).call(args[0])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling timeout(#{args[0]})"
  end
end

- (self) uri(value)

Configure the request to use a new request URI value.

When the uri has query parameters, they are set in the #query_params multimap, overwritting any parameters previously set.

Parameters:

  • value (String)

Returns:

  • (self)


402
403
404
405
406
407
408
409
410
411
412
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 402

def uri(*args)
  if args[0].class == String && !block_given?
    @j_del.java_method(:uri, [Java::java.lang.String.java_class]).call(args[0])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling uri(#{args[0]})"
  end
end

- (self) virtualHost(value)

Configure the request to use a virtual host value.

Usually the header host (:authority pseudo header for HTTP/2) is set from the request host value since this host value resolves to the server IP address.

Sometimes you need to set a host header for an address that does not resolve to the server IP address. The virtual host value overrides the value of the actual host header (:authority pseudo header for HTTP/2).

The virtual host is also be used for SNI.

Parameters:

  • value (String)

Returns:

  • (self)


185
186
187
188
189
190
191
192
193
194
195
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/http_request.rb', line 185

def virtual_host(*args)
  if args[0].class == String && !block_given?
    @j_del.java_method(:virtualHost, [Java::java.lang.String.java_class]).call(args[0])
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling virtual_host(#{args[0]})"
  end
end