REST Client Example in Ruby REST Client Example in Ruby ruby ruby

REST Client Example in Ruby


require 'rest-client'RestClient.get 'http://example.com/resource', {:params => {:id => 50, 'foo' => 'bar'}}RestClient.get 'http://example.com/resource'xml = '<xml><foo>bar</foo><bar>foo</bar></xml>'RestClient.post 'http://example.com/resource', xml , {:content_type => :xml}RestClient.put 'http://example.com/resource', xml , {:content_type => :xml}RestClient.delete 'http://example.com/resource'

See more examples and documentation at https://github.com/rest-client/rest-client


The Readme file at the git site for the rest-client gem has a whole bunch of examples of how to do requests, include parameters, etc.

I'd start with that.

If there are specific things that are not working, then it generally helps to post the code you've tried that you think SHOULD be working, and then it's usually easier for people to tell where you are going wrong.