Sha256: f5cd90593a21f73031d4912e00d7e85e265dd0051fcf7ac0dc64f30715df9bc2

Contents?: true

Size: 593 Bytes

Versions: 1

Compression:

Stored size: 593 Bytes

Contents

require 'typhoeus'

module Animoto
  module HTTPEngines
    class TyphoeusAdapter < Animoto::HTTPEngines::Base
      
      # @return [String]
      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    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
animoto-1.0.0 ./lib/animoto/http_engines/typhoeus_adapter.rb