From: ts Date: 2002-09-26T01:05:53+09:00 Subject: Re: http/net >>>>> "M" == Manfred Hansen writes: M> The page need a password and a user for login. Well, if you use basic authentification you have in the documentation === Basic Authentication require 'net/http' Net::HTTP.version_1_1 # declear to use 1.1 features. Net::HTTP.start( 'auth.some.domain' ) {|http| response, body = http.get( '/need-auth.cgi', 'Authorization' => 'Basic ' + ["#{account}:#{password}"].pack('m'). strip ) print body } In version 1.2 (Ruby 1.7 or later), you can write like this: require 'net/http' Net::HTTP.version_1_2 # declear to use 1.2 features. req = Net::HTTP::Get.new('/need-auth.cgi') req.basic_auth 'account', 'password' Net::HTTP.start( 'auth.some.domain' ) {|http| response = http.request(req) print response.body } Guy Decoux