class AWS::Core::Http::Response
-
body (the response body)
* headers (hash of response headers)
* status (200, 404, 500, etc)
Responses have:
Represents the http response from a service request.
def header name
-
(String, nil)
- The value of the given header
Parameters:
-
name
(String, Symbol
) -- The name of the header to fetch a value for.
def header name headers.each_pair do |header_name, header_value| if header_name.downcase == name.to_s.downcase return header_value.is_a?(Array) ? header_value.first : header_value end end nil end
def initialize options = {}, &block
(**options)
-
:body
(String
) -- HTTP response body -
:headers
(Hash
) -- HTTP response headers -
:status
(Integer
) -- HTTP status code
Parameters:
-
options
(Hash
) --
def initialize options = {}, &block @status = options[:status] || 200 @headers = options[:headers] || {} @body = options[:body] || '' yield(self) if block_given? self end