module Itrigga module NetHelper class RestClient def self.get( opts={} ) raise ArgumentError.new(":url is required") unless opts[:url] # rest_client expects :user and not :username opts[:user] ||= opts.delete(:username) if opts[:username] opts[:headers] = {:params => opts.delete(:params)} if opts[:params] response = ::RestClient::Request.new(opts.merge(:method => :get)).execute response.to_str end end end end