# Net/http and redirects

**URL:** <https://www.ruby-forum.com/t/net-http-and-redirects/139717>\
**Category:** Ruby\
**Created:** [June 6, 2008, 10:47am UTC](https://www.ruby-forum.com/t/net-http-and-redirects/139717 "2008-06-06T10:47:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Srijayanth\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e95f7d/32.png) [@Srijayanth\_S](https://www.ruby-forum.com/u/Srijayanth_S)\
**Post date:** [June 6, 2008, 10:47am UTC](https://www.ruby-forum.com/t/net-http-and-redirects/139717/1 "2008-06-06T10:47:08Z")

</div>

Hello,

I wrote this piece of code: [http://pastebin.com/m138ec5e4](http://pastebin.com/m138ec5e4)

I was looking at the examples posted on:

> **[Google ডেটা API-এর সাথে রুবি ব্যবহার করা  |  Google Data APIs...](https://developers.google.com/gdata/articles/using_ruby?visit_id=638263774021757315-4205609642&rd=1&hl=bn)**

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

---

<div class="post-metadata">

**Author:** ![Srijayanth\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e95f7d/32.png) [@Srijayanth\_S](https://www.ruby-forum.com/u/Srijayanth_S)\
**Post date:** [June 6, 2008, 4:11pm UTC](https://www.ruby-forum.com/t/net-http-and-redirects/139717/2 "2008-06-06T16:11:21Z")

</div>

On 6/6/08, Srijayanth S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thank you,
> 
> Jayanth

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

---

<div class="post-metadata">

**Author:** ![Srijayanth\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e95f7d/32.png) [@Srijayanth\_S](https://www.ruby-forum.com/u/Srijayanth_S)\
**Post date:** [June 6, 2008, 4:21pm UTC](https://www.ruby-forum.com/t/net-http-and-redirects/139717/3 "2008-06-06T16:21:23Z")

</div>

On Jun 6, 2008, at 10:08 AM, Per Christian Viken wrote:

> > around it?
> > 
> > Thank you,
> > 
> > Jayanth
> 
> The documentation for Net::HTTP  
> ([http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html](http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html)) 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 B. [http://agileconsultingllc.com](http://agileconsultingllc.com)  
removed\_email\_address@domain.invalid
