----- Original Message -----
From: "Neil Galarneau" <ngalarneau / mediaone.net>
> I'm using ruby to automate some tasks I have and would like to
> use it to fetch a file from a password protected web page (i.e. when
> I type the url into the web browser, it responds with a
> Username/Password
> popup which I must fillin BEFORE it shows me the page).

I believe you're looking for the "Authorization" header.
If you're using Basic authentication (as opposed to Digest) you'll want
something like:

require 'net/http'
require 'base64'

username = 'memyself'
password = '8letters'

Net::HTTP.start('my.domain.tld') do |http|
    headers = { 'Authorization' => 'Basic ' + encode64(username + ':' +
password) }
    response, body = http.get('/restricted/filename.ext', headers)
    puts body
end

This code has been tested to work, with only the names changed to protect
the guilty.

Brent