Sha256: 61ee710429968ea06e268d3da59040918f3ca5cb450a77239e13746a78a57302

Contents?: true

Size: 616 Bytes

Versions: 6

Compression:

Stored size: 616 Bytes

Contents

require 'typhoeus'

module Animoto
  class HTTPEngine
    class TyphoeusAdapter < Animoto::HTTPEngine
      
      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]
        })
        check_response response.code, response.body
        response.body
      end
      
    end
    
    adapter_map.merge! :typhoeus => TyphoeusAdapter
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
animoto-0.0.0.alpha9 ./lib/animoto/http_engines/typhoeus_adapter.rb
animoto-0.0.0.alpha8 ./lib/animoto/http_engines/typhoeus_adapter.rb
animoto-0.0.0.alpha7 ./lib/animoto/http_engines/typhoeus_adapter.rb
animoto-0.0.0.alpha6 ./lib/animoto/http_engines/typhoeus_adapter.rb
animoto-0.0.0.alpha5 ./lib/animoto/http_engines/typhoeus_adapter.rb
animoto-0.0.0.alpha4 ./lib/animoto/http_engines/typhoeus_adapter.rb