From: Robert Klemme Date: 2010-11-13T05:05:13+09:00 Subject: Re: Parsing XML with Ruby On 11/12/2010 03:23 PM, jackster the jackle wrote: > botp wrote in post #960964: >> >> response = http.get('/index.html') >> #=> # >> >> response.body > > That does help and thank you. > Prior to your post, I was able to get the following working which is > similar to what you gave me: > --------- > uri = URI.parse("https://www.chase.com/") > http = Net::HTTP.new(uri.host, uri.port) > http.use_ssl = true > http.verify_mode = OpenSSL::SSL::VERIFY_NONE > request = Net::HTTP::Get.new(uri.request_uri) > response = http.request(request) > puts response.body > response["header-here"] # All headers are lowercase > ---------- > I am able to pull the page from Chase but the https url that I really > need requires a one time username and password which I am having trouble > with. > > I tried modifying the uri to be: > --------- > uri = URI.parse("https://myusername:mypassword@www.myurl.com/") > --------- > > but that didn't work so I tried adding this which I got from Google: > --------- > http.basic_auth("username", "password") > --------- > > Am I proceeding down the right path with the authentication? Both approaches above should be equivalent. Question is which authentication method the website uses. It may as well be form fields (sent via POST for example) or even via a certificate. Kind regards robert