Sha256: d5dc77ffe7a33a4beee9d17659a5530f27d61fde0600817a0c45abed08cfc4d3

Contents?: true

Size: 625 Bytes

Versions: 12

Compression:

Stored size: 625 Bytes

Contents

require 'restclient'

module Animoto
  module HTTPEngines
    class RestClientAdapter < Animoto::HTTPEngines::Base
      
      # @return [String]
      def request method, url, body = nil, headers = {}, options = {}
        RestClient.proxy = options[:proxy]
        response = ::RestClient::Request.execute({
          :method => method,
          :url => url,
          :headers => headers,
          :payload => body,
          :user => options[:username],
          :password => options[:password],
          :timeout => options[:timeout]
        })
        [response.code, response.body]
      end
    end    
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
animoto-1.5.6 ./lib/animoto/http_engines/rest_client_adapter.rb
animoto-1.5.5 ./lib/animoto/http_engines/rest_client_adapter.rb
animoto-1.5.4 ./lib/animoto/http_engines/rest_client_adapter.rb
animoto-1.5.3 ./lib/animoto/http_engines/rest_client_adapter.rb
animoto-1.5.2 ./lib/animoto/http_engines/rest_client_adapter.rb
animoto-1.5.1 ./lib/animoto/http_engines/rest_client_adapter.rb
animoto-1.5.0 ./lib/animoto/http_engines/rest_client_adapter.rb
animoto-1.3.1 ./lib/animoto/http_engines/rest_client_adapter.rb
animoto-1.3.0 ./lib/animoto/http_engines/rest_client_adapter.rb
animoto-1.2.0 ./lib/animoto/http_engines/rest_client_adapter.rb
animoto-1.1.1 ./lib/animoto/http_engines/rest_client_adapter.rb
animoto-1.1.0 ./lib/animoto/http_engines/rest_client_adapter.rb