I'm pleased to introduce the next release of Resourceful, 0.2.1. This one has tons of bugfixes over 0.2, and is actually being used in production. There's only one real new feature to speak of is prettier logging output. It shows the runtime for requests, the resulting status code, and if it was retrieved from the cache. Some sample log output:
GET [http://core.ssbe.localhost/service_descriptors] -> Returned 200 in 0.0146s GET [http://core.ssbe.localhost/service_descriptors] Retrieved from cache -> Returned 200 in 0.0003s
The code to do that is simple, as always:
require 'rubygems' require 'resourceful' http = Resourceful::HttpAccessor.new(:logger => Resourceful::StdOutLogger.new, :cache_manager => Resourceful::InMemoryCacheManager.new) res = http.resource("http://core.ssbe.localhost/service_desciptors") mime_type = 'application/json' res.get(:accept => mime_type) res.get(:accept => mime_type)
I've seen the release of a couple other Rest-HTTP libraries since I started working on Resourceful, HTTParty and rest-client. They're worth checking out, but they lack some of the more powerful features of Resourceful, such as the free HTTP Caching demonstrated above.