lib/riemann/babbler/plugins/helpers/rest.rb in riemann-babbler-2.8.2 vs lib/riemann/babbler/plugins/helpers/rest.rb in riemann-babbler-2.8.3
- old
+ new
@@ -1,8 +1,9 @@
#encoding: utf-8
-require 'rest_client'
+require 'uri'
+require 'net/http'
module Riemann
module Babbler
module Plugins
module Helpers
@@ -10,10 +11,12 @@
# http rest
def rest_get(url)
begin
Timeout::timeout(plugin.timeout) do
begin
- RestClient.get url
+ res = ::Net::HTTP.get_response(URI(url))
+ raise ::Net::HTTPError unless res.kind_of?(::Net::HTTPSuccess)
+ res.body
rescue
raise "Get from url: #{url} failed"
end
end
rescue Timeout::Error