Class: Vertx::HttpClientResponse

Inherits:
Object
  • Object
show all
Includes:
ReadStream
Defined in:
src/main/api_shim/core/http.rb

Overview

Encapsulates a client-side HTTP response. An instance of this class is provided to the user via a handler that was specified when one of the HTTP method operations, or the generic Vertx::HttpClient#request method was called on an instance of HttpClient.

Author:

Instance Method Summary (collapse)

Methods included from ReadStream

#data_handler, #end_handler, #exception_handler, #pause, #resume

Instance Method Details

- (Object) body_handler(&hndlr)

Set a handler to receive the entire body in one go - do not use this for large bodies


496
497
498
499
# File 'src/main/api_shim/core/http.rb', line 496

def body_handler(&hndlr)
  @j_del.bodyHandler(hndlr)
  self
end

- (Object) cookies

Get all cookies


488
489
490
491
492
493
# File 'src/main/api_shim/core/http.rb', line 488

def cookies
  if !@cookies
    @cookies = @j_del.cookies
  end
  @cookies
end

- (String) header(key)

Get a header value

Parameters:

  • key. (String)
    The key of the header.

Returns:

  • (String)
    the header value.


465
466
467
# File 'src/main/api_shim/core/http.rb', line 465

def header(key)
  @j_del.getHeader(key)
end

- (MultiMap) headers

Get all the headers in the response.

Returns:



471
472
473
474
475
476
# File 'src/main/api_shim/core/http.rb', line 471

def headers
  if !@headers
    @headers = MultiMap.new(@j_del.headers)
  end
  @headers
end

- (FixNum) status_code

The HTTP status code of the response.

Returns:

  • (FixNum)
    the HTTP status code of the response.


453
454
455
# File 'src/main/api_shim/core/http.rb', line 453

def status_code
  @j_del.statusCode
end

- (String) status_message

The status message

Returns:

  • (String)
    the status message


458
459
460
# File 'src/main/api_shim/core/http.rb', line 458

def status_message
  @j_del.statusMessage
end

- (MultiMap) trailers

Get all the trailers in the response.

Returns:



480
481
482
483
484
485
# File 'src/main/api_shim/core/http.rb', line 480

def trailers
  if !@trailers
    @trailers = MultiMap.new(@j_del.trailers)
  end
  @trailers
end