Summon::FaradayMiddleware

Faraday middleware to authenticate against the Serials Solutions Summon Unified Discovery Service API. For more information on the API, see http://api.summon.serialssolutions.com/help/api/.

Installation

Add this line to your application's Gemfile:

gem 'summon-faraday_middleware'

And then execute:

$ bundle

Or install it yourself as:

$ gem install summon-faraday_middleware

Usage

conn = Faraday.new(:url => 'http://api.summon.serialssolutions.com') do |builder|
  builder.request :summon_auth,
    :access_id => 'my_access_id', :secret_key => 'my_secret_key'
  builder.adapter Faraday.default_adapter # or any other adapter
end

response = conn.get('/2.0.0/search') do |req|
  req.headers['Accept'] = 'application/json' # or xml
  req.params['s.q'] = 'My Query'
end

puts response.body

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request