Class: UU::OS::HTTP::HTTPGet

Inherits:
HTTPMethod show all
Defined in:
uu_os_connection-2.2.4/lib/uu/os/http/http_get.rb

Overview

GET Method.

Instance Attribute Summary

Attributes inherited from HTTPMethod

#headers, #method, #parameters, #path

Instance Method Summary (collapse)

Methods inherited from HTTPMethod

#set_header, #set_parameter

Instance Method Details

- (HTTPMethod) accept(*content_type)

Sets custom Accept header.

Parameters:

  • content_type (Array<String>)

    Accepted content-type.

Returns:

  • (HTTPMethod)

    Self instance for configuration chaining.



24
25
26
27
# File 'uu_os_connection-2.2.4/lib/uu/os/http/http_get.rb', line 24

def accept(*content_type)
  headers[:accept] = content_type
  return self
end

- (UU::OS::HTTP::HTTPResponse) execute(parameters = nil)

Executes method. In case you need to stream response, execute_async should be used.

Parameters:

  • parameters (Hash) (defaults to: nil)

    Query parameters in form of simple key-value hash (nested structures are serialized to JSON). These parameters overwrites parameters with same name given directly via set_parameter or parameters methods.

Returns:



34
35
36
37
# File 'uu_os_connection-2.2.4/lib/uu/os/http/http_get.rb', line 34

def execute(parameters = nil)
  prepare_query(parameters)
  super()
end

- (UU::OS::HTTP::HTTPResponse) execute_async(parameters = nil)

Executes method asynchronously. Unlike execute, this call is non blocking.

Parameters:

  • parameters (Hash) (defaults to: nil)

    Query parameters in form of simple key-value hash (nested structures are serialized to JSON). These parameters overwrites parameters with same name given directly via set_parameter or parameters methods.

Returns:



44
45
46
47
# File 'uu_os_connection-2.2.4/lib/uu/os/http/http_get.rb', line 44

def execute_async(parameters = nil)
  prepare_query(parameters)
  super()
end