# How to connect to other server (Like cURL in php) in Ruby on

**URL:** <https://www.ruby-forum.com/t/how-to-connect-to-other-server-like-curl-in-php-in-ruby-on/110727>\
**Category:** Rails\
**Created:** [July 30, 2007, 10:58am UTC](https://www.ruby-forum.com/t/how-to-connect-to-other-server-like-curl-in-php-in-ruby-on/110727 "2007-07-30T10:58:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amjith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c0e974/32.png) [@Amjith](https://www.ruby-forum.com/u/Amjith)\
**Post date:** [July 30, 2007, 10:58am UTC](https://www.ruby-forum.com/t/how-to-connect-to-other-server-like-curl-in-php-in-ruby-on/110727/1 "2007-07-30T10:58:14Z")

</div>

hi Friends,

i am a new programmer in Ruby On Rails, i need a help regarding

connecting to other server as cURL in php in ROR. so i hope got my  
query.

that is i need to connect my page to other server to reteive some  
information on that server. so how can i so that job in RoR?

give me a help please!

thanks and regards.  
Amjith PS

removed\_email\_address@domain.invalid  
+91 9388880335

---

<div class="post-metadata">

**Author:** ![Amjith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c0e974/32.png) [@Amjith](https://www.ruby-forum.com/u/Amjith)\
**Post date:** [July 30, 2007, 11:36am UTC](https://www.ruby-forum.com/t/how-to-connect-to-other-server-like-curl-in-php-in-ruby-on/110727/2 "2007-07-30T11:36:16Z")

</div>

Hi Amjith,

Ruby (the language) gives you a few possibilities for connecting to a  
remote server. For your needs you’ll probably want Net::HTTP, also  
check out the excellent open-uri. Both are included in the standard  
Ruby dist, so just do:

require ‘rubygems’  
require ‘open-uri’

thepage = open(‘[http://someurl.com/mypage](http://someurl.com/mypage)’)

Rails (the framework) also comes with a library for consuming REST  
based webservices, so if that’s your thing you should check it out,  
it’s called active\_resource.

/Jonas

P.S.: Some years ago two guys called Larry and Sergei started a rather  
nifty website which helps in researching this sort of thing. Can’t  
seem to remember the name, has a lot of o’s in it though.
