Sha256: 048bc2721fd2c38bcb66ab89b46a2cfcbfd1e7dfdea48ed7cd2ffc7abdfebf17

Contents?: true

Size: 1.45 KB

Versions: 7

Compression:

Stored size: 1.45 KB

Contents

Faraday Middleware
==================

A collection of useful [Faraday][] middleware. [See the documentation][docs].

    gem install faraday_middleware

Dependencies
------------

Some dependent libraries are needed only when using specific middleware:

* FaradayMiddleware::EncodeJson & FaradayMiddleware::ParseJson: "json"
  for ruby older than 1.9
* FaradayMiddleware::ParseXml: "multi_xml"
* FaradayMiddleware::OAuth: "simple_oauth"
* FaradayMiddleware::Mashify: "hashie"
* FaradayMiddleware::Rashify: "rash"
* FaradayMiddleware::Instrumentation: "activesupport"

Examples
--------

``` rb
require 'faraday_middleware'

## in Faraday 0.8 or above:
connection = Faraday.new 'http://example.com/api' do |conn|
  conn.request :oauth2, 'TOKEN'
  conn.request :json

  conn.response :xml,  :content_type => /\bxml$/
  conn.response :json, :content_type => /\bjson$/

  conn.use :instrumentation
  conn.adapter Faraday.default_adapter
end

## with Faraday 0.7:
connection = Faraday.new 'http://example.com/api' do |builder|
  builder.use FaradayMiddleware::OAuth2, 'TOKEN'
  builder.use FaradayMiddleware::EncodeJson

  builder.use FaradayMiddleware::ParseXml,  :content_type => /\bxml$/
  builder.use FaradayMiddleware::ParseJson, :content_type => /\bjson$/

  builder.use FaradayMiddleware::Instrumentation
  builder.adapter Faraday.default_adapter
end
```


  [faraday]: https://github.com/lostisland/faraday#readme
  [docs]: https://github.com/lostisland/faraday_middleware/wiki

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/faraday_middleware-0.11.0.1/README.md
faraday_middleware-0.11.0.1 README.md
faraday_middleware-0.10.1 README.md
faraday_middleware-0.10.0 README.md
faraday_middleware-0.9.2 README.md
faraday_middleware-0.9.1 README.md
agiley-faraday_middleware-0.9.1 README.md