lib/lenddo/authentication.rb in lenddo-1.0.1 vs lib/lenddo/authentication.rb in lenddo-1.1.0
- old
+ new
@@ -3,19 +3,22 @@
require 'json'
require 'openssl'
module Lenddo
module Authentication
- def signed_request(method, host, path, params={})
- uri = URI.parse(host + path)
+ def signed_request(args)
+ host = args[:host]
+ method = args[:method].downcase
+ path = args[:path]
+ params = args[:params]
- method = method.downcase
if (method == 'post' || method == 'put')
body = params
else
body = {}
end
+ uri = URI.parse(host + path)
Curl.send(method.to_s, uri.to_s, params) do |http|
headers = sign(method.upcase, path, body)
headers.each do |key, value|
http.headers[key] = value.chomp
end
\ No newline at end of file