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...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
open-uri and redirection
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password