Class: Fluent::Plugin::SdnsApiSinger::HttpRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/aksk/signer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method = "", url = "", headers = nil, body = "") ⇒ HttpRequest

Returns a new instance of HttpRequest.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fluent/plugin/aksk/signer.rb', line 36

def initialize(method = "", url = "", headers = nil, body = "")
  @method = method
  uri_parse=URI.parse(url)

  spl = url.split("://", 2)
  @scheme = 'http'
  if spl.length > 1
    @scheme = spl[0]
    url = spl[1]
  end
  @query = {}
  if uri_parse.query
    @query = CGI.parse(uri_parse.query)
  end
  @host = uri_parse.host
  @uri = uri_parse.path
  @headers = headers.nil? ? {} : headers.dup
  @body = body.encode('utf-8')
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



34
35
36
# File 'lib/fluent/plugin/aksk/signer.rb', line 34

def body
  @body
end

#headersObject

Returns the value of attribute headers.



34
35
36
# File 'lib/fluent/plugin/aksk/signer.rb', line 34

def headers
  @headers
end

#hostObject

Returns the value of attribute host.



34
35
36
# File 'lib/fluent/plugin/aksk/signer.rb', line 34

def host
  @host
end

#methodObject

Returns the value of attribute method.



34
35
36
# File 'lib/fluent/plugin/aksk/signer.rb', line 34

def method
  @method
end

#queryObject

Returns the value of attribute query.



34
35
36
# File 'lib/fluent/plugin/aksk/signer.rb', line 34

def query
  @query
end

#schemeObject

Returns the value of attribute scheme.



34
35
36
# File 'lib/fluent/plugin/aksk/signer.rb', line 34

def scheme
  @scheme
end

#uriObject

Returns the value of attribute uri.



34
35
36
# File 'lib/fluent/plugin/aksk/signer.rb', line 34

def uri
  @uri
end