lib/testingbot/api.rb in testingbot-0.1.1 vs lib/testingbot/api.rb in testingbot-0.1.2
- old
+ new
@@ -51,11 +51,11 @@
def get(url)
uri = URI(API_URL + '/v' + VERSION.to_s + url)
req = Net::HTTP::Get.new(uri.request_uri)
req.basic_auth @config[:client_key], @config[:client_secret]
- res = Net::HTTP.start(uri.hostname, uri.port) {|http|
+ res = Net::HTTP.start(uri.host, uri.port) {|http|
http.request(req)
}
parsed = JSON.parse(res.body)
@@ -69,11 +69,11 @@
def put(url, params = {})
uri = URI(API_URL + '/v' + VERSION.to_s + url)
req = Net::HTTP::Put.new(uri.request_uri)
req.basic_auth @config[:client_key], @config[:client_secret]
req.set_form_data(params)
- res = Net::HTTP.start(uri.hostname, uri.port) {|http|
+ res = Net::HTTP.start(uri.host, uri.port) {|http|
http.request(req)
}
parsed = JSON.parse(res.body)
@@ -87,10 +87,10 @@
def delete(url, params = {})
uri = URI(API_URL + '/v' + VERSION.to_s + url)
req = Net::HTTP::Delete.new(uri.request_uri)
req.basic_auth @config[:client_key], @config[:client_secret]
req.set_form_data(params)
- res = Net::HTTP.start(uri.hostname, uri.port) {|http|
+ res = Net::HTTP.start(uri.host, uri.port) {|http|
http.request(req)
}
parsed = JSON.parse(res.body)
\ No newline at end of file