Class: AWS::Core::Http::NetHttpHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/aws/core/http/net_http_handler.rb

Overview

The default http request handler for the aws-sdk gem. It is based on Net::Http.

Instance Method Summary collapse

Instance Method Details

#handle(request, response) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/aws/core/http/net_http_handler.rb', line 26

def handle request, response
  http_session_for(request) do |http|
    begin
      http_resp = http.request(build_request(request))
      response.body = http_resp.body
      response.status = http_resp.code.to_i
      response.headers = http_resp.to_hash
    rescue Timeout::Error, Errno::ETIMEDOUT => e
      response.timeout = true
    end
  end
end