-
Notifications
You must be signed in to change notification settings - Fork 203
Changes 0.8
When upgrading from v0.7, the v0.8 should be backwards-compatible for the most part.
-
All middleware names have changed. Previously they were nested in the Faraday namespace, such as "Faraday::Response::*". Now they are all under FaradayMiddleware namespace, e.g. FaradayMiddleware::ParseJson.
The old constants have been deprecated and will be removed.
-
New middleware:
- FaradayMiddleware::EncodeJson
- FaradayMiddleware::Caching
- FaradayMiddleware::FollowRedirects
- FaradayMiddleware::Instrumentation
- FaradayMiddleware::RackCompatible
-
Parsing middleware has gained extra features. JSON-parsing middleware doesn't use MultiJson anymore.
-
Extra features and greater flexibility in OAuth/OAuth2 middleware.
-
All middleware is now registered with Faraday 0.8, enabling referencing them with symbol shortcuts rather than full class names:
require 'faraday_middleware' ## in Faraday 0.8 or above: connection = Faraday.new 'http://example.com/api' do |conn| conn.request :json conn.response :xml, :content_type => /\bxml$/ conn.use :instrumentation conn.adapter Faraday.default_adapter end
(Please note: This wiki has been closed, and turned into in-repo Markdown
documents. You can find them in the repository's docs/
directory. This wiki does not take new edits.)