9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/koala/http_services/typhoeus_service.rb', line 9
def self.make_request(path, args, verb, options = {})
args.merge!({:method => verb}) && verb = "post" if verb != "get" && verb != "post"
args.each_pair {|key, value| args[key] = value.to_file if value.is_a?(UploadableIO)}
typhoeus_options = {:params => args}.merge(options[:typhoeus_options] || {})
typhoeus_options[:proxy] ||= proxy
typhoeus_options[:timeout] ||= timeout
prefix = (args["access_token"] || @always_use_ssl || options[:use_ssl]) ? "https" : "http"
response = Typhoeus::Request.send(verb, "#{prefix}://#{server(options)}#{path}", typhoeus_options)
Koala::Response.new(response.code, response.body, response.)
end
|