[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Net/http and redirects

Srijayanth Sridhar

6/6/2008 8:45:00 AM

Hello,

I wrote this piece of code: http://pastebin.com...

I was looking at the examples posted on:
http://code.google.com/support/bin/answer.py?answer=93164&t...

The problem seems to be that google is somehow redirecting and net
http isn't following. Is this known behaviour? If so is there a way
around it?

Thank you,

Jayanth

2 Answers

Per Christian Viken

6/6/2008 2:09:00 PM

0

On 6/6/08, Srijayanth Sridhar <srijayanth@gmail.com> wrote:
> Hello,
>
> I wrote this piece of code: http://pastebin.com...
>
> I was looking at the examples posted on:
> http://code.google.com/support/bin/answer.py?answer=93164&t...
>
> The problem seems to be that google is somehow redirecting and net
> http isn't following. Is this known behaviour? If so is there a way
> around it?
>
> Thank you,
>
> Jayanth
>

The documentation for Net::HTTP
(http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/...) has a
section on following redirects. That might be of interest.

Rob Biedenharn

6/6/2008 2:20:00 PM

0

On Jun 6, 2008, at 10:08 AM, Per Christian Viken wrote:
> On 6/6/08, Srijayanth Sridhar <srijayanth@gmail.com> wrote:
>> Hello,
>>
>> I wrote this piece of code: http://pastebin.com...
>>
>> I was looking at the examples posted on:
>> http://code.google.com/support/bin/answer.py?answer=93164&t...
>>
>> The problem seems to be that google is somehow redirecting and net
>> http isn't following. Is this known behaviour? If so is there a way
>> around it?
>>
>> Thank you,
>>
>> Jayanth
>>
>
> The documentation for Net::HTTP
> (http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/...) has a
> section on following redirects. That might be of interest.


If you want automatic following of redirects, perhaps you want the
httpclient gem rather than Net::HTTP directly. With Net::HTTP, you'd
have to recognize and follow the redirect explicitly.

-Rob

Rob Biedenharn http://agileconsult...
Rob@AgileConsultingLLC.com