Skip to content

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

License

Notifications You must be signed in to change notification settings

blendle/excon-addressable

Repository files navigation

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.

About

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

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages