lib/auger/plugin/http.rb in auger-1.3.4 vs lib/auger/plugin/http.rb in auger-1.3.5

- old
+ new

@@ -60,10 +60,11 @@ end class HttpRequest < Auger::Request attr_accessor :method, :headers, :user, :password, :data + alias_method :url, :arg def initialize(url) @method ||= :get # default @headers = {} @data = {} @@ -85,11 +86,11 @@ def password(password) @password = password end - def run(http) - request = Net::HTTP::const_get(@method.capitalize).new(@arg) # e.g. Net::HTTP::Get + def run(http, url) + request = Net::HTTP::const_get(@method.capitalize).new(url) # e.g. Net::HTTP::Get request.basic_auth(@user, @password || '') if @user @headers.each { |k,v| request[k] = v } request.set_form_data(@data) http.request(request) end