From: Rk Ch Date: 2008-02-15T12:48:19+09:00 Subject: Re: Net::HTTP and handling 302 Redirect I meet two kinds of redirect: "Location" response and tag. Here's my solution: ================================================ require 'net/http' require 'net/https' http = Net::HTTP.new('www.microsoft.com', 80) resp, data = http.get('/',nil) #1."Location" response redirect... if resp.response['Location']!=nil then puts 'Direct to: ' + resp.response['Location'] redirectUrl=resp.response['Location'] end #2. tag redirect... redirectUrl=data.scan(//).to_s if redirectUrl!=nil then puts 'Direct to: ' +redirectUrl end -- Posted via http://www.ruby-forum.com/.