From: Carl Youngblood Date: 2001-02-18T05:10:01+09:00 Subject: [ruby-talk:11020] Re: Net::HTTP with basic authentication Thanks! "ts" wrote in message news:200102161747.f1GHlIF14477@orsay1.moulon.inra.fr... > >>>>> "C" == Carl Youngblood writes: > > C> Does anyone know how I can use the Net::HTTP class to access a site that > C> uses basic authentication? > > Something like this : > > require 'net/http' > require 'base64' > enc = "Basic " + encode64("username:passwd") > http = Net::HTTP.new('host.domain') > http.get('/some_file', 'Authorization' => enc) do |recv| > puts recv > end > > > > Guy Decoux > > >