Date
1 - 1 of 1
[ANN] rest-client-components 1.1.0
Cyril ROHR <cyril.rohr@...>
Hi, or gem install rest-client-components In short, it is meant to be a "RestClient on steroids" by making RestClient RACK-compatible. As a consequence, you may wrap your request with as many Rack middleware as you wish, just like you would do with Sinatra or other rack-enabled application server.
One of the most compelling use case for me is to be able to enable transparent caching for requests in one line, thanks to the Rack::Cache gem (the work on rest-client-components stems from the former cacheability gem):
RestClient.enable Rack::Cache, {...rack-cache options...} RestClient.get "http://some/cacheable/resource"
Other interesting use cases would include transparent parsing of response body, transparent authentication, transparent logging, profiling, exception/non-2xx status codes handling, etc. As for all Rack-enabled app, you have full access to the environment (inc. HTTP headers) of the request you send, and the headers, status and body of the response you receive.
Check it out and report bugs/suggestions! Cyril -- |
|