From: Bill Kelly Date: 2003-10-26T05:51:31+09:00 Subject: Re: Question for http experts Hi, From: "Andrew Walrond" > > I have to type > http://username:password@www.some.url/downloads/file > into a browser to download a file. How can I do this with the net/http module > in ruby? There's - I suspect - a more elegant way to do this, but here's what I use: require 'net/http' require 'base64' user_pass = "username:password" auth_header = { 'Authorization' => 'Basic '+encode64(user_pass).chop } http = Net::HTTP.new('www.some.host') resp, data = http.get("/some_page.html", auth_header) Hope this helps, Bill