RestClient 0.6 includes an interactive shell contributed by Blake Mizerany. Lay down your curl
, for we now have a Ruby Way to fetch resources at the command line!
$ restclient
>> RestClient.get 'http://rest-test.heroku.com'
Specify a URL argument for a RestClient::Resource instantiated for that resource:
$ restclient http://rest-test.heroku.com
>> put '/resource', :foo => 'baz'
Add a user and password for authentication:
$ restclient https://example.com user pass
>> delete '/private/resource'
Create named sessions in ~/.restclient:
sinatra:
url: http://localhost:4567
rack:
url: http://localhost:9292
private_site:
url: https://example.com
username: user
password: pass
Then invoke:
$ restclient private_site
RestClient also now has nested parameters, courtesey of Pedro Belo:
RestClient.post 'http://rest-test.heroku.com', :container => { :one => 1, :two => 2 }
gem install rest-client
, rdocs.