# How to make REST web client

**URL:** <https://www.ruby-forum.com/t/how-to-make-rest-web-client/143399>\
**Category:** Rails\
**Created:** [July 18, 2008, 3:00am UTC](https://www.ruby-forum.com/t/how-to-make-rest-web-client/143399 "2008-07-18T03:00:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bishal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a698b9/32.png) [@bishal](https://www.ruby-forum.com/u/bishal)\
**Post date:** [July 18, 2008, 3:00am UTC](https://www.ruby-forum.com/t/how-to-make-rest-web-client/143399/1 "2008-07-18T03:00:43Z")

</div>

I have to make a REST client, making use of Activeresource, The problem  
is I have to make a custom web interface to make calls to the server  
resources. How should I do it ? I have been able to make REST calls via  
command prompt though ?Will appreciate any suggestions.

---

<div class="post-metadata">

**Author:** ![bishal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a698b9/32.png) [@bishal](https://www.ruby-forum.com/u/bishal)\
**Post date:** [July 18, 2008, 8:27am UTC](https://www.ruby-forum.com/t/how-to-make-rest-web-client/143399/2 "2008-07-18T08:27:44Z")

</div>

The book RESTful Web Services has a great explanation on how to do it.

Basically make a RESTful website requires that you understand the API of  
the  
RESTful web service you want to connect to. Once you have that,  
basically  
all you do it create wrapper classes for the various url calls. So lets  
say  
there is a resource called {BOX} and a get request gets a list of the  
box,  
all you have to do is then use either http/net or open-uri and send a  
get  
request to the server. If it is a true rest service with put, delete and  
header files then you have to install a gem that does more than just get  
and  
post. Will post a more detailed explanation later. Also please specfiy  
the  
web service and maybe I can help more.

Reuben Doetsch

On Thu, Jul 17, 2008 at 8:00 PM, Bishal A. \<

---

<div class="post-metadata">

**Author:** ![bishal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a698b9/32.png) [@bishal](https://www.ruby-forum.com/u/bishal)\
**Post date:** [July 18, 2008, 9:16am UTC](https://www.ruby-forum.com/t/how-to-make-rest-web-client/143399/3 "2008-07-18T09:16:45Z")

</div>

Thanx for your reply. I had previously used http/net and open-uri but  
later opted for ActiveResource, because of open-uri only supporting get,  
I want to make a custom GUI from which I want to access the server  
service exposed as rows objects, In the meantime, I am able to make  
restful calls to the server using all four methods(get,post,put,delete)  
through a web interface, what I have done is used the ActiveResource  
library and made a custom Ruby class including methods suitable  
according to my requirements then through the gui, been able to make all  
four calls to the services ? I am afraid am I violating any constraints  
making my system Restful.

Here is how I am doing…For example to delete a resource in the server  
lets say

[http://www.server.com/users/1](http://www.server.com/users/1)

In the client application I am doing,  
[http://www.client.com/users/delete/1](http://www.client.com/users/delete/1)

and which in turn calls the custom method in the client side which then  
invokes the activeresource library actually making delete http call to  
the server service and this time [http://www.client.com/users/1](http://www.client.com/users/1), the work  
is performed though…I am not sure about the way I am proceedings, Is it  
a fine way of working with REST or may be I have to look for the  
alternatives may be Javascript client ???

reuben doetsch wrote:

> The book RESTful Web Services has a great explanation on how to do it.
> 
> Basically make a RESTful website requires that you understand the API of  
> the  
> RESTful web service you want to connect to. Once you have that,  
> basically  
> all you do it create wrapper classes for the various url calls. So lets  
> say  
> there is a resource called {BOX} and a get request gets a list of the  
> box,  
> all you have to do is then use either http/net or open-uri and send a  
> get  
> request to the server. If it is a true rest service with put, delete and  
> header files then you have to install a gem that does more than just get  
> and  
> post. Will post a more detailed explanation later. Also please specfiy  
> the  
> web service and maybe I can help more.
> 
> Reuben Doetsch
> 
> On Thu, Jul 17, 2008 at 8:00 PM, Bishal A. \<
