# Consuming a RESTful webservice in Rails

**URL:** <https://www.ruby-forum.com/t/consuming-a-restful-webservice-in-rails/133694>\
**Category:** Rails\
**Created:** [April 2, 2008, 5:38pm UTC](https://www.ruby-forum.com/t/consuming-a-restful-webservice-in-rails/133694 "2008-04-02T17:38:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javier\_CH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c57346/32.png) [@Javier\_CH](https://www.ruby-forum.com/u/Javier_CH)\
**Post date:** [April 2, 2008, 5:38pm UTC](https://www.ruby-forum.com/t/consuming-a-restful-webservice-in-rails/133694/1 "2008-04-02T17:38:56Z")

</div>

Can anyone point me to an url regarding how to consume a REST-  
webservice in rails?

I did find tons of websites and posts on how to use REST _inside_ a  
Rails-app and some on how to serve a REST-webservice, but didn’t find  
one on how to consume it.

There are tons of tutorials and howtos regarding ActionWebService with  
easy examples on how to consume and serve SOAP-webservices but I  
couldn’t find nothing nearly as informative for ActiveResource.

Am I just to stupid to find such a tutorial/howto or is all the hype  
about REST just about using it inside an application and not as  
replacement for SOAP/ActionWebService?

Thanks a lot for your help/opinions!

Saludos  
Javier

---

<div class="post-metadata">

**Author:** ![Javier\_CH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c57346/32.png) [@Javier\_CH](https://www.ruby-forum.com/u/Javier_CH)\
**Post date:** [April 2, 2008, 5:59pm UTC](https://www.ruby-forum.com/t/consuming-a-restful-webservice-in-rails/133694/2 "2008-04-02T17:59:41Z")

</div>

to be more detailed about my problem:

I’m writing rails-server-app A that includes class Foo and I like to  
work with an object of class Foo in rails-client-app B. Is  
ActiveResource or ActionWebService the better and easier way to do  
that?

---

<div class="post-metadata">

**Author:** ![Javier\_CH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c57346/32.png) [@Javier\_CH](https://www.ruby-forum.com/u/Javier_CH)\
**Post date:** [April 2, 2008, 6:02pm UTC](https://www.ruby-forum.com/t/consuming-a-restful-webservice-in-rails/133694/3 "2008-04-02T18:02:03Z")

</div>

Hi Javier,

ActiveResource would be the way to do it.

Regards  
Nicolai

---

<div class="post-metadata">

**Author:** ![Javier\_CH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c57346/32.png) [@Javier\_CH](https://www.ruby-forum.com/u/Javier_CH)\
**Post date:** [April 2, 2008, 6:20pm UTC](https://www.ruby-forum.com/t/consuming-a-restful-webservice-in-rails/133694/4 "2008-04-02T18:20:03Z")

</div>

Thanks…but could you point me to a howto, the relevant api-doc or a  
tutorial on how to do it? 🙂

---

<div class="post-metadata">

**Author:** ![Javier\_CH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c57346/32.png) [@Javier\_CH](https://www.ruby-forum.com/u/Javier_CH)\
**Post date:** [April 2, 2008, 6:43pm UTC](https://www.ruby-forum.com/t/consuming-a-restful-webservice-in-rails/133694/5 "2008-04-02T18:43:12Z")

</div>

Those two railscast did solve my problem:

> **[\#94 ActiveResource Basics - RailsCasts](http://railscasts.com/episodes/94-activeresource-basics)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

> **[\#95 More on ActiveResource - RailsCasts](http://railscasts.com/episodes/95-more-on-activeresource)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.
