Class: UU::OS::HTTP::HTTPMethod

Inherits:
Object
  • Object
show all
Defined in:
uu_os_connection-2.2.4/lib/uu/os/http/http_method.rb

Overview

Generic ancestor for HTTP methods.

Direct Known Subclasses

HTTPGet, HTTPPost

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (UU::OS::HTTP::HTTPHeaders) headers (readonly)

Custom method headers.

Returns:



23
24
25
# File 'uu_os_connection-2.2.4/lib/uu/os/http/http_method.rb', line 23

def headers
  @headers
end

- (Symbol) method (readonly)

Actual method type (POST, GET, etc).

Returns:

  • (Symbol)

    Method type.



15
16
17
# File 'uu_os_connection-2.2.4/lib/uu/os/http/http_method.rb', line 15

def method
  @method
end

- (UU::OS::HTTP::HTTPQuery) parameters (readonly)

Query parameters.

Returns:



27
28
29
# File 'uu_os_connection-2.2.4/lib/uu/os/http/http_method.rb', line 27

def parameters
  @parameters
end

- (String) path (readonly)

Method path.

Returns:

  • (String)

    Path.



19
20
21
# File 'uu_os_connection-2.2.4/lib/uu/os/http/http_method.rb', line 19

def path
  @path
end

Instance Method Details

- (HTTPMethod) set_header(name, *value)

Sets custom header.

Parameters:

  • name (Symbol, String)

    Header name (case insensitive).

  • value (Array<String>)

    Header value.

Returns:

  • (HTTPMethod)

    Self instance for configuration chaining.



46
47
48
49
# File 'uu_os_connection-2.2.4/lib/uu/os/http/http_method.rb', line 46

def set_header(name, *value)
  headers[name] = value
  return self
end

- (HTTPMethod) set_parameter(name, value)

Sets query parameter.

Parameters:

  • name (Symbol, String)

    Parameter name.

  • value (String)

    Parameter value.

Returns:

  • (HTTPMethod)

    Self instance for configuration chaining.



55
56
57
58
# File 'uu_os_connection-2.2.4/lib/uu/os/http/http_method.rb', line 55

def set_parameter(name, value)
  parameters[name] = value
  return self
end