Faraday Middleware for JSON HAL requests and responses
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.rspec
.rubocop.yml
.rubocop_todo.yml
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
Gemfile
LICENSE.txt
README.md
RELEASING.md
Rakefile
faraday_hal_middleware.gemspec

README.md

FaradayHalMiddleware

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

Build Status

Installation

Add this line to your application's Gemfile:

gem 'faraday_hal_middleware'

Usage

Use faraday_hal_middleware in a similar way to other Faraday 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.