Class: Fluent::Plugin::SdnsApiSinger::HttpRequest
- Inherits:
-
Object
- Object
- Fluent::Plugin::SdnsApiSinger::HttpRequest
- Defined in:
- lib/fluent/plugin/aksk/signer.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#host ⇒ Object
Returns the value of attribute host.
-
#method ⇒ Object
Returns the value of attribute method.
-
#query ⇒ Object
Returns the value of attribute query.
-
#scheme ⇒ Object
Returns the value of attribute scheme.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(method = "", url = "", headers = nil, body = "") ⇒ HttpRequest
constructor
A new instance of HttpRequest.
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
#body ⇒ Object
Returns the value of attribute body.
34 35 36 |
# File 'lib/fluent/plugin/aksk/signer.rb', line 34 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
34 35 36 |
# File 'lib/fluent/plugin/aksk/signer.rb', line 34 def headers @headers end |
#host ⇒ Object
Returns the value of attribute host.
34 35 36 |
# File 'lib/fluent/plugin/aksk/signer.rb', line 34 def host @host end |
#method ⇒ Object
Returns the value of attribute method.
34 35 36 |
# File 'lib/fluent/plugin/aksk/signer.rb', line 34 def method @method end |
#query ⇒ Object
Returns the value of attribute query.
34 35 36 |
# File 'lib/fluent/plugin/aksk/signer.rb', line 34 def query @query end |
#scheme ⇒ Object
Returns the value of attribute scheme.
34 35 36 |
# File 'lib/fluent/plugin/aksk/signer.rb', line 34 def scheme @scheme end |
#uri ⇒ Object
Returns the value of attribute uri.
34 35 36 |
# File 'lib/fluent/plugin/aksk/signer.rb', line 34 def uri @uri end |