From: Fred Phillips Date: 2007-05-23T00:01:14+09:00 Subject: Gmail atom feed ------=_Part_68323_6991383.1179846074066 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I'm trying to use basic auth to retrieve my Gmail atom feed but I keep on getting "Connection reset by peer". Here's the code: $URL_FEED = 'https://mail.google.com/mail/feed/atom' def retrieve puts "Retrieving mail count..." @url = URI.parse($URL_FEED) h = Net::HTTP.new(@url.host,@url.port) begin unpw = [@email,@password] unpw = @unpw.join(':') z=[unpw].pack("m") @unpwd={'Authorization' => 'Basic ' + z } puts @unpwd resp = h.get(@url.path,@unpwd) @headers = "" resp.each {|key,val| @headers.concat("#{key}: #{val}\n")} puts @response.body rescue Net::ProtoFatalError => detail head = detail.data head.each {|key,val| puts "#{key} #{val}"} end end ------=_Part_68323_6991383.1179846074066--