tags:

views:

86

answers:

3
+1  Q: 

REST with ruby?

Are there good references teaching you how to send PUT/DELETE/POST/GET with ruby?

I have looked at Net::HTTP.

Is this library capable of all four methods? I couldn't find how to send with PUT.

Are there other good libraries for all these four methods?

+2  A: 

Look here http://www.rubyinside.com/nethttp-cheat-sheet-2940.html

Nakilon
Great cheat sheet!
never_had_a_name
+3  A: 

You should definitely look at HTTParty. It's an easy to use library to deal with RESTful requests, JSON responses and so forth.

floatless
+1  A: 

The simplest way would probably be to use the rest client gem. Then you can do stuff like

RestClient.get 'http://example.com/resource', {:params => {:id => 50, 'foo' => 'bar'}}

EDIT: changed url to a more up to date one.

yxhuvud
hmm that hasnt been updated in 1 year now. seems that the project is dead.
never_had_a_name
My bad. It has moved to github. http://github.com/archiloque/rest-client
yxhuvud