Class: Seahorse::Client::Http::Request
- Inherits:
-
Object
- Object
- Seahorse::Client::Http::Request
- Defined in:
- lib/seahorse/client/http/request.rb
Instance Attribute Summary collapse
- #body ⇒ IO
- #endpoint ⇒ URI::HTTP, ...
-
#headers ⇒ Headers
The hash of request headers.
-
#http_method ⇒ String
The HTTP request method, e.g.
Instance Method Summary collapse
- #body_contents ⇒ String
-
#initialize(options = {}) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(options = {}) ⇒ Request
Returns a new instance of Request.
13 14 15 16 17 18 |
# File 'lib/seahorse/client/http/request.rb', line 13 def initialize( = {}) self.endpoint = [:endpoint] if [:endpoint] self.http_method = [:http_method] || 'GET' self.headers = Headers.new([:headers] || {}) self.body = [:body] end |
Instance Attribute Details
#body ⇒ IO
30 31 32 |
# File 'lib/seahorse/client/http/request.rb', line 30 def body @body end |
#endpoint ⇒ URI::HTTP, ...
21 22 23 |
# File 'lib/seahorse/client/http/request.rb', line 21 def endpoint @endpoint end |
#headers ⇒ Headers
Returns The hash of request headers.
27 28 29 |
# File 'lib/seahorse/client/http/request.rb', line 27 def headers @headers end |
#http_method ⇒ String
Returns The HTTP request method, e.g. ‘GET`, `PUT`, etc.
24 25 26 |
# File 'lib/seahorse/client/http/request.rb', line 24 def http_method @http_method end |
Instance Method Details
#body_contents ⇒ String
45 46 47 48 49 50 |
# File 'lib/seahorse/client/http/request.rb', line 45 def body_contents body.rewind contents = body.read body.rewind contents end |