Amjith
2007-Jul-30 08:57 UTC
How to connect to other server (Like cURL in php) in Ruby on rails.
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 amjithps-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org +91 9388880335 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
JN_Coward
2007-Jul-30 09:35 UTC
Re: How to connect to other server (Like cURL in php) in Ruby on rails.
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'')
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.
On 30 Juli, 17:57, Amjith
<amjit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> 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
>
> amjit...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> +91 9388880335
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---