lib/gotransverse-tract-api.rb in gotransverse-tract-api-0.0.10 vs lib/gotransverse-tract-api.rb in gotransverse-tract-api-0.0.11
- old
+ new
@@ -173,19 +173,21 @@
#
def self.call(api_url, api_params={}, method=:get)
headers = self.get_authentication_headers
- # TODO: Recursively camelize all keys in api_params Hash.
+ # TODO: Camelize all keys in api_params Hash.
+ api_uri = URI.parse(api_url)
+
http_client = HTTPClient.new
case method
when :get
- response = http_client.get(api_url, api_params, headers)
+ response = http_client.get(api_uri, api_params, headers)
when :post
- response = http_client.post(api_url, api_params, headers)
+ response = http_client.post(api_uri, api_params, headers)
when :put
- response = http_client.put(api_url, api_params, headers)
+ response = http_client.put(api_uri, api_params, headers)
end
Nokogiri::XML(response.body.to_s)
end