Class: Vertx::HttpServerRequest

Inherits:
Object
  • Object
show all
Includes:
ReadStream
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb

Overview

Represents a server-side HTTP request.

Instances are created for each request and passed to the user via a handler.

Each instance of this class is associated with a corresponding HttpServerResponse instance via #response.

It implements ReadStream so it can be used with Pump to pump data with flow control.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)

36
37
38
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 36

def @@j_api_type.accept?(obj)
  obj.class == HttpServerRequest
end

+ (Object) j_api_type


45
46
47
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 45

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class


48
49
50
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 48

def self.j_class
  Java::IoVertxCoreHttp::HttpServerRequest.java_class
end

+ (Object) unwrap(obj)


42
43
44
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 42

def @@j_api_type.unwrap(obj)
  obj.j_del
end

+ (Object) wrap(obj)


39
40
41
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 39

def @@j_api_type.wrap(obj)
  HttpServerRequest.new(obj)
end

Instance Method Details

- (String) absolute_uri

Returns the absolute URI corresponding to the the HTTP request

Returns:

  • (String)
    the absolute URI corresponding to the the HTTP request

Raises:

  • (ArgumentError)

242
243
244
245
246
247
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 242

def absolute_uri
  if !block_given?
    return @j_del.java_method(:absoluteURI, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling absolute_uri()"
end

- (self) body_handler { ... }

Convenience method for receiving the entire request body in one piece.

This saves the user having to manually setting a data and end handler and append the chunks of the body until the whole body received. Don't use this if your request body is large - you could potentially run out of RAM.

Yields:

  • This handler will be called after all the body has been received

Returns:

  • (self)

Raises:

  • (ArgumentError)

254
255
256
257
258
259
260
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 254

def body_handler
  if block_given?
    @j_del.java_method(:bodyHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::Vertx::Buffer)) }))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling body_handler()"
end

- (Fixnum) bytes_read

Returns the total number of bytes read for the body of the request.

Returns:

  • (Fixnum)
    the total number of bytes read for the body of the request.

Raises:

  • (ArgumentError)

167
168
169
170
171
172
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 167

def bytes_read
  if !block_given?
    return @j_del.java_method(:bytesRead, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling bytes_read()"
end

- (::Vertx::HttpConnection) connection

Returns the Vertx::HttpConnection associated with this request

Returns:

Raises:

  • (ArgumentError)

383
384
385
386
387
388
389
390
391
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 383

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) custom_frame_handler { ... }

Set a custom frame handler. The handler will get notified when the http stream receives an custom HTTP/2 frame. HTTP/2 permits extension of the protocol.

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)

375
376
377
378
379
380
381
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 375

def custom_frame_handler
  if block_given?
    @j_del.java_method(:customFrameHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::Vertx::HttpFrame)) }))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling custom_frame_handler()"
end

- (self) end_handler { ... }

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)

96
97
98
99
100
101
102
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 96

def end_handler
  if block_given?
    @j_del.java_method(:endHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })
    return self
  end
  raise ArgumentError, "Invalid arguments when calling end_handler()"
end

- (true, false) ended?

Has the request ended? I.e. has the entire request, including the body been read?

Returns:

  • (true, false)
    true if ended

Raises:

  • (ArgumentError)

365
366
367
368
369
370
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 365

def ended?
  if !block_given?
    return @j_del.java_method(:isEnded, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling ended?()"
end

- (self) exception_handler { ... }

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)

53
54
55
56
57
58
59
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 53

def exception_handler
  if block_given?
    @j_del.java_method(:exceptionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) }))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling exception_handler()"
end

- (true, false) expect_multipart?

Returns true if we are expecting a multi-part body for this request. See #set_expect_multipart.

Returns:

  • (true, false)
    true if we are expecting a multi-part body for this request. See #set_expect_multipart.

Raises:

  • (ArgumentError)

310
311
312
313
314
315
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 310

def expect_multipart?
  if !block_given?
    return @j_del.java_method(:isExpectMultipart, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling expect_multipart?()"
end

- (self) fetch(amount = nil)

Parameters:

  • amount (Fixnum) (defaults to: nil)

Returns:

  • (self)

Raises:

  • (ArgumentError)

87
88
89
90
91
92
93
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 87

def fetch(amount=nil)
  if amount.class == Fixnum && !block_given?
    @j_del.java_method(:fetch, [Java::long.java_class]).call(amount)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling fetch(#{amount})"
end

- (::Vertx::MultiMap) form_attributes

Returns a map of all form attributes in the request.

Be aware that the attributes will only be available after the whole body has been received, i.e. after the request end handler has been called.

#set_expect_multipart must be called first before trying to get the form attributes.

Returns:

Raises:

  • (ArgumentError)

334
335
336
337
338
339
340
341
342
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 334

def form_attributes
  if !block_given?
    if @cached_form_attributes != nil
      return @cached_form_attributes
    end
    return @cached_form_attributes = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:formAttributes, []).call(),::Vertx::MultiMap)
  end
  raise ArgumentError, "Invalid arguments when calling form_attributes()"
end

- (String) get_form_attribute(attributeName = nil)

Return the first form attribute value with the specified name

Parameters:

  • attributeName (String) (defaults to: nil)
    the attribute name

Returns:

  • (String)
    the attribute value

Raises:

  • (ArgumentError)

346
347
348
349
350
351
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 346

def get_form_attribute(attributeName=nil)
  if attributeName.class == String && !block_given?
    return @j_del.java_method(:getFormAttribute, [Java::java.lang.String.java_class]).call(attributeName)
  end
  raise ArgumentError, "Invalid arguments when calling get_form_attribute(#{attributeName})"
end

- (String) get_header(headerName = nil)

Return the first header value with the specified name

Parameters:

  • headerName (String) (defaults to: nil)
    the header name

Returns:

  • (String)
    the header value

Raises:

  • (ArgumentError)

196
197
198
199
200
201
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 196

def get_header(headerName=nil)
  if headerName.class == String && !block_given?
    return @j_del.java_method(:getHeader, [Java::java.lang.String.java_class]).call(headerName)
  end
  raise ArgumentError, "Invalid arguments when calling get_header(#{headerName})"
end

- (String) get_param(paramName = nil)

Return the first param value with the specified name

Parameters:

  • paramName (String) (defaults to: nil)
    the param name

Returns:

  • (String)
    the param value

Raises:

  • (ArgumentError)

215
216
217
218
219
220
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 215

def get_param(paramName=nil)
  if paramName.class == String && !block_given?
    return @j_del.java_method(:getParam, [Java::java.lang.String.java_class]).call(paramName)
  end
  raise ArgumentError, "Invalid arguments when calling get_param(#{paramName})"
end

- (self) handler { ... }

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)

62
63
64
65
66
67
68
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 62

def handler
  if block_given?
    @j_del.java_method(:handler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::Vertx::Buffer)) }))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling handler()"
end

- (::Vertx::MultiMap) headers

Returns the headers in the request.

Returns:

Raises:

  • (ArgumentError)

184
185
186
187
188
189
190
191
192
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 184

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

- (String) host

Returns the request host. For HTTP2 it returns the pseudo header otherwise it returns the header

Returns:

  • (String)
    the request host. For HTTP2 it returns the pseudo header otherwise it returns the header

Raises:

  • (ArgumentError)

160
161
162
163
164
165
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 160

def host
  if !block_given?
    return @j_del.java_method(:host, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling host()"
end

- (::Vertx::SocketAddress) local_address

Returns the local (server side) address of the server that handles the request

Returns:

Raises:

  • (ArgumentError)

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

def local_address
  if !block_given?
    if @cached_local_address != nil
      return @cached_local_address
    end
    return @cached_local_address = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:localAddress, []).call(),::Vertx::SocketAddress)
  end
  raise ArgumentError, "Invalid arguments when calling local_address()"
end

- (:OPTIONS, ...) method

Returns the HTTP method for the request.

Returns:

  • (:OPTIONS, :GET, :HEAD, :POST, :PUT, :DELETE, :TRACE, :CONNECT, :PATCH, :OTHER)
    the HTTP method for the request.

Raises:

  • (ArgumentError)

111
112
113
114
115
116
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 111

def method
  if !block_given?
    return @j_del.java_method(:method, []).call().name.intern
  end
  raise ArgumentError, "Invalid arguments when calling method()"
end

- (::Vertx::NetSocket) net_socket

Get a net socket for the underlying connection of this request.

This method must be called before the server response is ended.

With CONNECT requests, a 200 response is sent with no content-length header set before returning the socket.


 server.requestHandler(req -> {
   if (req.method() == HttpMethod.CONNECT) {
     // Send a 200 response to accept the connect
     NetSocket socket = req.netSocket();
     socket.handler(buff -> {
       socket.write(buff);
     });
   }
   ...
 });
 

For other HTTP/1 requests once you have called this method, you must handle writing to the connection yourself using the net socket, the server request instance will no longer be usable as normal. USE THIS WITH CAUTION! Writing to the socket directly if you don't know what you're doing can easily break the HTTP protocol.

With HTTP/2, a 200 response is always sent with no content-length header set before returning the socket like in the CONNECT case above.

Returns:

Raises:

  • (ArgumentError)

289
290
291
292
293
294
295
296
297
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 289

def net_socket
  if !block_given?
    if @cached_net_socket != nil
      return @cached_net_socket
    end
    return @cached_net_socket = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:netSocket, []).call(),::Vertx::NetSocket)
  end
  raise ArgumentError, "Invalid arguments when calling net_socket()"
end

- (::Vertx::MultiMap) params

Returns the query parameters in the request

Returns:

Raises:

  • (ArgumentError)

203
204
205
206
207
208
209
210
211
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 203

def params
  if !block_given?
    if @cached_params != nil
      return @cached_params
    end
    return @cached_params = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:params, []).call(),::Vertx::MultiMap)
  end
  raise ArgumentError, "Invalid arguments when calling params()"
end

- (String) path

Returns The path part of the uri. For example /somepath/somemorepath/someresource.foo

Returns:

  • (String)
    The path part of the uri. For example /somepath/somemorepath/someresource.foo

Raises:

  • (ArgumentError)

146
147
148
149
150
151
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 146

def path
  if !block_given?
    return @j_del.java_method(:path, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling path()"
end

- (self) pause

Returns:

  • (self)

Raises:

  • (ArgumentError)

70
71
72
73
74
75
76
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 70

def pause
  if !block_given?
    @j_del.java_method(:pause, []).call()
    return self
  end
  raise ArgumentError, "Invalid arguments when calling pause()"
end

- (String) query

Returns the query part of the uri. For example someparam=32&someotherparam=x

Returns:

  • (String)
    the query part of the uri. For example someparam=32&someotherparam=x

Raises:

  • (ArgumentError)

153
154
155
156
157
158
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 153

def query
  if !block_given?
    return @j_del.java_method(:query, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling query()"
end

- (String) raw_method

Returns the HTTP method as sent by the client

Returns:

  • (String)
    the HTTP method as sent by the client

Raises:

  • (ArgumentError)

118
119
120
121
122
123
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 118

def raw_method
  if !block_given?
    return @j_del.java_method(:rawMethod, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling raw_method()"
end

- (::Vertx::SocketAddress) remote_address

Returns the remote (client side) address of the request

Returns:

Raises:

  • (ArgumentError)

222
223
224
225
226
227
228
229
230
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 222

def remote_address
  if !block_given?
    if @cached_remote_address != nil
      return @cached_remote_address
    end
    return @cached_remote_address = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:remoteAddress, []).call(),::Vertx::SocketAddress)
  end
  raise ArgumentError, "Invalid arguments when calling remote_address()"
end

- (::Vertx::HttpServerResponse) response

Returns the response. Each instance of this class has an Vertx::HttpServerResponse instance attached to it. This is used to send the response back to the client.

Returns:

Raises:

  • (ArgumentError)

174
175
176
177
178
179
180
181
182
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 174

def response
  if !block_given?
    if @cached_response != nil
      return @cached_response
    end
    return @cached_response = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:response, []).call(),::Vertx::HttpServerResponse)
  end
  raise ArgumentError, "Invalid arguments when calling response()"
end

- (self) resume

Returns:

  • (self)

Raises:

  • (ArgumentError)

78
79
80
81
82
83
84
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 78

def resume
  if !block_given?
    @j_del.java_method(:resume, []).call()
    return self
  end
  raise ArgumentError, "Invalid arguments when calling resume()"
end

- (String) scheme

Returns the scheme of the request

Returns:

  • (String)
    the scheme of the request

Raises:

  • (ArgumentError)

132
133
134
135
136
137
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 132

def scheme
  if !block_given?
    return @j_del.java_method(:scheme, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling scheme()"
end

- (self) set_expect_multipart(expect = nil)

Call this with true if you are expecting a multi-part body to be submitted in the request. This must be called before the body of the request has been received

Parameters:

  • expect (true, false) (defaults to: nil)
    true - if you are expecting a multi-part body

Returns:

  • (self)

Raises:

  • (ArgumentError)

302
303
304
305
306
307
308
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 302

def set_expect_multipart(expect=nil)
  if (expect.class == TrueClass || expect.class == FalseClass) && !block_given?
    @j_del.java_method(:setExpectMultipart, [Java::boolean.java_class]).call(expect)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling set_expect_multipart(#{expect})"
end

- (true, false) ssl?

Returns true if this NetSocket is encrypted via SSL/TLS

Returns:

  • (true, false)
    true if this NetSocket is encrypted via SSL/TLS

Raises:

  • (ArgumentError)

125
126
127
128
129
130
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 125

def ssl?
  if !block_given?
    return @j_del.java_method(:isSSL, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling ssl?()"
end

- (Hash) stream_priority

Returns the priority of the associated HTTP/2 stream for HTTP/2 otherwise null

Returns:

  • (Hash)
    the priority of the associated HTTP/2 stream for HTTP/2 otherwise null

Raises:

  • (ArgumentError)

393
394
395
396
397
398
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 393

def stream_priority
  if !block_given?
    return @j_del.java_method(:streamPriority, []).call() != nil ? JSON.parse(@j_del.java_method(:streamPriority, []).call().toJson.encode) : nil
  end
  raise ArgumentError, "Invalid arguments when calling stream_priority()"
end

- (self) stream_priority_handler { ... }

Set an handler for stream priority changes

This is not implemented for HTTP/1.x.

Yields:

  • the handler to be called when stream priority changes

Returns:

  • (self)

Raises:

  • (ArgumentError)

404
405
406
407
408
409
410
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 404

def stream_priority_handler
  if block_given?
    @j_del.java_method(:streamPriorityHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) }))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling stream_priority_handler()"
end

- (::Vertx::ServerWebSocket) upgrade

Upgrade the connection to a WebSocket connection.

This is an alternative way of handling WebSockets and can only be used if no websocket handlers are set on the Http server, and can only be used during the upgrade request during the WebSocket handshake.

Returns:

Raises:

  • (ArgumentError)

357
358
359
360
361
362
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 357

def upgrade
  if !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:upgrade, []).call(),::Vertx::ServerWebSocket)
  end
  raise ArgumentError, "Invalid arguments when calling upgrade()"
end

- (self) upload_handler { ... }

Set an upload handler. The handler will get notified once a new file upload was received to allow you to deal with the file upload.

Yields:

Returns:

  • (self)

Raises:

  • (ArgumentError)

320
321
322
323
324
325
326
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 320

def upload_handler
  if block_given?
    @j_del.java_method(:uploadHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::Vertx::HttpServerFileUpload)) }))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling upload_handler()"
end

- (String) uri

Returns the URI of the request. This is usually a relative URI

Returns:

  • (String)
    the URI of the request. This is usually a relative URI

Raises:

  • (ArgumentError)

139
140
141
142
143
144
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 139

def uri
  if !block_given?
    return @j_del.java_method(:uri, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling uri()"
end

- (:HTTP_1_0, ...) version

Returns the HTTP version of the request

Returns:

  • (:HTTP_1_0, :HTTP_1_1, :HTTP_2)
    the HTTP version of the request

Raises:

  • (ArgumentError)

104
105
106
107
108
109
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/http_server_request.rb', line 104

def version
  if !block_given?
    return @j_del.java_method(:version, []).call().name.intern
  end
  raise ArgumentError, "Invalid arguments when calling version()"
end