Class: Animoto::HTTPEngines::TyphoeusAdapter

Inherits:
Base
  • Object
show all
Defined in:
lib/animoto/http_engines/typhoeus_adapter.rb

Instance Method Summary collapse

Instance Method Details

#request(method, url, body = nil, headers = {}, options = {}) ⇒ String

Returns:

  • (String)


8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/animoto/http_engines/typhoeus_adapter.rb', line 8

def request method, url, body = nil, headers = {}, options = {}
  response = ::Typhoeus::Request.run(url, {
    :method => method,
    :body => body,
    :headers => headers,
    :timeout => options[:timeout],
    :username => options[:username],
    :password => options[:password],
    :disable_ssl_peer_verification => true,
    :proxy => options[:proxy]
  })
  [response.code, response.body]
end