Adam @ Heroku
a tornado of razorblades

Rest Client 0.2

Posted by Adam Wiggins on March 11, 2008 at 12:16 AM

Based on Dan Kubb's suggestion, I've implemented an ActiveResource-style accessor for rest-client. This also supports basic auth, so now:

r = RestClient::Resource.new('http://example.com/photos/', user, pass)
r.put File.read('pic.jpg'), :content_type => 'image/jpg'

The static methods for raw URL access are still available as well. See the updated RDocs for details.

Hierarchy: previous, next

Comments

There are 3 comments on this post. Post yours →

Simply beautiful. With this, it no longer makes sense to extend ActiveResource to consume non-Rails style REST API. Thanks!

Hey Adam -

This is a wonderful gem and I'm already using it in two of my projects. Any chance on uploading it to a git repository for others to hack away on? :-)

Never mind - I should learn to read documentation!

Post a comment

Required fields in bold.