No commit activity in last 3 years
No release in over 3 years
Collection+JSON parsing middleware for faraday.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Faraday Collection JSON

This Faraday middleware parses collection+json responses using the collection-json gem.

service = Faraday.new do |builder|
  builder.response :collection_json, :content_type => /collection\+json$/
  builder.adapter  :net_http
end

collection = service.get('http://www.service.org/').body
collection.href                       # => 'http://www.service.org/'
collection.links.first.tap do |link|
  link.rel                            # => 'feed'
  link.href                           # => 'http://www.service.org/feed.rss'
end