Project

curlyrest

0.0
Low commit activity in last 3 years
No release in over a year
gem extending rest-client, allowing use/debug of curl for request
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 12.3.3
~> 3.0

Runtime

~> 11.1
 Project Readme

Curlyrest

Welcome to curlyrest. In years of testing RESTful APIs, it was regularly beneficial to be able to substitute execution via curl for a request which normally would have been executed with RestClient. This might have been because observation of the exact request wasn't easy, or because RestClient had some unexplained restriction. Having a tool that could execute the request via curl and optionally expose the output, allowed observing the exact failing request. It was also possible to pass the curl request to a colleague without having them deal with environment, ruby, or data complications to be able to replicate a failure.

Installation

Add this line to your application's Gemfile:

gem 'curlyrest'

And then execute:

$ bundle

Or install it yourself as:

$ gem install curlyrest

Usage

Simply replace your use of require 'rest-client' with require 'curlyrest', and optionally add header of :use_curl with either 'debug' (which will output the curl request / response) or any other value (which will execute via curl, but not output). The curl executed response is returned as compatable with rest-client. Environment variable FORCE_CURL_DEBUG will cause all API calls to be executed and output with curl.

Development

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in lib/curlyrest/version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Limitations

Curlyrest works with basic requests, including responses with content-encoding: 'gzip'. I would not be suprised to find some more complicated requests that are not supported at this time.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/keithrw54/curlyrest.

License

The gem is available as open source under the terms of the MIT License.