From: Shashank Date Date: 2003-09-09T13:01:06+09:00 Subject: Re: "Moved Temporarily"? "Ben Giddings" wrote in message > The other difference is that in 1.8, a 300 series error (a redirect) is > no longer an exception. Instead, you have to examine the return codes > and check to see if it was a redirect, using something like: > > def getPage(url, header_hash, retry_count) > > raise("Too many redirects") if 10 < retry_count > > case response > when Net::HTTPSuccess > response > when Net::HTTPRedirection > getPage(url.merge(URI.parse(response['location'])), > header_hash, > retry_count + 1) > else > response.error! > end > end > > Ben Thanks for sharing this insight, Ben. -- shanko