Open-uri and redirection

According to the Pick Axe Book, open-uri automatically handles
redirection for HTTP files, but I do not see this behavior. Here is an
example from irb:

open(‘http://some.web.site’)
RuntimeError: redirection forbidden: http://some.web.site ->
https://some.web.site

I would like for redirection to just work… any tips?

Thanks,
Brad

On Mon, Oct 30, 2006 at 04:24:18AM +0900, Brad T. wrote:

Thanks,
Brad

Try using WWW::Mechanize. It will handle the redirects automatically
for you.
http://mechanize.rubyforge.org/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs