lib/mkit/client/http_client.rb in mkit-0.8.0 vs lib/mkit/client/http_client.rb in mkit-0.9.0
- old
+ new
@@ -36,18 +36,20 @@
raise InvalidParametersException, 'Invalid mkit server uri. Please check configuration'
end
@client.request(req)
end
- def request(request, request_data = nil)
+ def request(request, request_data = {})
req = nil
uri = request[:uri]
request[:file] = request_data[:file]
unless request[:params].nil? || request[:params].empty?
- uri = uri + '?' + request[:params].map { |k, v| "#{k}=#{v}" }.join('&')
+ uri = uri + '?' + request[:params].map { |k| "#{k}=#{request_data[k]}" }.join('&')
end
uri = ERB.new(uri).result_with_hash(request_data)
+ # puts "Request URI: #{uri}"
+
case request[:verb].to_sym
when :post
req = Net::HTTP::Post.new(uri)
unless request[:file].nil?
(body, boundary) = attach(request[:file])