[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

open-uri and redirection

Brad Tilley

10/29/2006 7:24:00 PM

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...)
RuntimeError: redirection forbidden: http://som... ->
https://som...

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

Thanks,
Brad

--
Posted via http://www.ruby-....

1 Answer

Aaron Patterson

10/30/2006 6:58:00 AM

0

On Mon, Oct 30, 2006 at 04:24:18AM +0900, Brad Tilley wrote:
> 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...)
> RuntimeError: redirection forbidden: http://som... ->
> https://som...
>
> I would like for redirection to just work... any tips?
>
> Thanks,
> Brad

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

--
Aaron Patterson
http://tenderlovem...