Forum: Ruby re net::http and htaccess

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Charlie Bowman (Guest)
on 2006-06-13 21:07
(Received via mailing list)
I should of googled authentication instead of htaccess.  Sorry for the
noise.  Here is the solution

Basic Authentication

    require 'net/http'

    Net::HTTP.start('www.example.com') {|http|
      req = Net::HTTP::Get.new('/secret-page.html')
      req.basic_auth 'account', 'password'
      response = http.request(req)
      print response.body
    }



Charlie Bowman
http://www.recentrambles.com
This topic is locked and can not be replied to.