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. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2009-Nov-27 16:38 UTC
Re: Ruby client to interface with Rails'' REST implementation
On Nov 27, 4:10 pm, skarayan <skara...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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.ActiveResource ? Fred -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
skarayan
2009-Nov-27 17:25 UTC
Re: Ruby client to interface with Rails'' REST implementation
Let me clarify. I want to be able to generate a standalone ruby API for any rails project. Essentially, I am looking for something higher level than REXML and ActiveResource. Perhaps a scaffold script to auto-generate a wrapper for ActiveResource based on the given project? On Nov 27, 11:38 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Nov 27, 4:10 pm, skarayan <skara...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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. > > ActiveResource ? > > Fred-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Nicholas Wieland
2009-Nov-29 02:58 UTC
Re: Ruby client to interface with Rails'' REST implementation
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.