Class: Seahorse::Client::Http::Request

Inherits:
Object
  • Object
show all
Defined in:
aws-sdk-core/lib/seahorse/client/http/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Request

Returns a new instance of Request

Options Hash (options):

  • :endpoint (URI::HTTP, URI::HTTPS) — default: nil
  • :http_method (String) — default: 'GET'
  • :headers (Headers) — default: Headers.new
  • :body (Body) — default: StringIO.new

13
14
15
16
17
18
# File 'aws-sdk-core/lib/seahorse/client/http/request.rb', line 13

def initialize(options = {})
  self.endpoint = options[:endpoint] if options[:endpoint]
  self.http_method = options[:http_method] || 'GET'
  self.headers = Headers.new(options[:headers] || {})
  self.body = options[:body]
end

Instance Attribute Details

#bodyIO


30
31
32
# File 'aws-sdk-core/lib/seahorse/client/http/request.rb', line 30

def body
  @body
end

#endpointURI::HTTP, ...


21
22
23
# File 'aws-sdk-core/lib/seahorse/client/http/request.rb', line 21

def endpoint
  @endpoint
end

#headersHeaders


27
28
29
# File 'aws-sdk-core/lib/seahorse/client/http/request.rb', line 27

def headers
  @headers
end

#http_methodString


24
25
26
# File 'aws-sdk-core/lib/seahorse/client/http/request.rb', line 24

def http_method
  @http_method
end

Instance Method Details

#body_contentsString


45
46
47
48
49
50
# File 'aws-sdk-core/lib/seahorse/client/http/request.rb', line 45

def body_contents
  body.rewind
  contents = body.read
  body.rewind
  contents
end