From 11aa7c3e702f4ea466152b706f60e154e60e188e Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 17 Apr 2010 15:28:17 -0400 Subject: [PATCH] Allow passing headers (default: {}) to the Website get_page_data method. --- src/website.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/website.rb b/src/website.rb index bfa1b3d..2f03e6c 100644 --- a/src/website.rb +++ b/src/website.rb @@ -56,13 +56,13 @@ class Website - def get_page_data(url) + def get_page_data(url, headers = {}) # A naive implementation that just grabs the # data from a page. uri = URI.parse(url) response = Net::HTTP.start(uri.host, uri.port) do |http| - http.get(uri.request_uri) + http.get(uri.request_uri, headers) end return response.body -- 2.44.2