On Nov 27, 2009, at 5:10 PM, skarayan wrote:

> I'd like to create a ruby client to interface with my rails
> application's REST API.
> What's the best way of achieving this?  My main goal is to avoid
> dealing with the resulting XML manually.
> Thank you.

I would try 2 ways: HTTParty and rest-client.
They are both nice with some differences along the lines:
1) HTTParty handles the XML/JSON response using Crack
2) RestClient doesn't handle the response but you can find a branch that 
supports mulipart uploads, something that is not supported on HTTParty (but I 
might be wrong, someone on ruby-lang claimed that it's possible to make a 
multipart form-data upload with HTTParty as well, maybe I just missed the code 
inside the library ...). Here you have to handle the XML yourself, but you can 
use Crack as well which is fairly easy to do.

They both expose a very nice DSL, and soon RestClient will support OAuth (when 
I find a decent way to support it, I already have something working).

HTH,
  ngw

--

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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to