No commit activity in last 3 years
No release in over 3 years
Excon, with Addressable baked in.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 5.11
~> 0.11
~> 12.3
~> 0.52

Runtime

~> 0.60
 Project Readme

Excon::Addressable wercker status

Sets Addressable as the default URI parser. Supports parsing templated uris.

Installation

Add this line to your application's Gemfile:

gem 'excon-addressable'

And then execute:

bundle

Or install it yourself as:

gem install excon-addressable

Usage

Be sure to add Excon::Addressable::Middleware to the top of the middleware stack, so that the variables get expanded as early as possible. This prevents other middleware from choking on non-valid URIs.

Excon.defaults[:middlewares].unshift(Excon::Addressable::Middleware)

Then simply provide a templated variable, and the values with which to expand the template:

conn = Excon.new('http://www.example.com/{uid}', expand: { uid: 'hello' })
conn.request.path # => '/hello'

License

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