Low commit activity in last 3 years
A long-lived project that still receives updates
Faraday Middleware for JSON HAL requests and responses.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 2.0
 Project Readme

FaradayHalMiddleware

Faraday Middleware for JSON HAL requests and responses with application/hal+json content-type.

test

Installation

Add this line to your application's Gemfile:

gem 'faraday_hal_middleware'

Use version 0.1.1 for Faraday 1.x, and >= 0.2.0 for newer versions of Faraday.

Usage

Use faraday_hal_middleware.

require 'faraday_hal_middleware'

connection = Faraday.new 'http://example.com/api' do |conn|
  conn.request :hal_json
  conn.response :hal_json, content_type: /\bjson$/

  conn.adapter Faraday.default_adapter
end

This gem is notably used in Hyperclient, see hyperclient#81 for details.

Contributing

See CONTRIBUTING.

Copyright & License

Copyright (c) 2014-2018 Koen Punt koen@fetch.nl and contributors.

MIT License, see LICENSE.txt for details.