GithubHelp home page GithubHelp logo

isabella232 / faraday_middleware Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lostisland/faraday_middleware

0.0 0.0 0.0 445 KB

Various Faraday middlewares for Faraday-based API wrappers

License: MIT License

Ruby 99.21% Shell 0.79%

faraday_middleware's Introduction

Faraday Middleware

Gem Version GitHub Actions CI

A collection of useful Faraday middleware. See the documentation.

gem install faraday_middleware

⚠️ DEPRECATION WARNING ⚠️

As highlighted in Faraday's UPGRADING guide, faraday_middleware is DEPRECATED, and will not be updated to support Faraday 2.0. If you rely on faraday_middleware in your project and would like to support Faraday 2.0:

  • The json middleware (request and response) are now both bundled with Faraday 🙌
  • The instrumentation middleware is bundled with Faraday
  • All other middleware, they'll be re-released as independent gems compatible with both Faraday v1 and v2

Most of the middleare are looking for adoption, contributors that would like to maintain them. If you'd like to maintain any middleware, have any question or need any help, we're here! Please reach out opening an issue or a discussion.

Dependencies

Ruby >= 2.3.0

As of v0.16.0, faraday and faraday_middleware no longer officially support JRuby or Rubinius.

Some dependent libraries are needed only when using specific middleware:

Middleware Library Notes
FaradayMiddleware::Instrumentation activesupport
FaradayMiddleware::OAuth simple_oauth
FaradayMiddleware::ParseXml multi_xml
FaradayMiddleware::ParseYaml safe_yaml Not backwards compatible with versions of this middleware prior to faraday_middleware v0.12. See code comments for alternatives.
FaradayMiddleware::Mashify hashie
FaradayMiddleware::Rashify rash_alt Make sure to uninstall original rash gem to avoid conflict.

Examples

require 'faraday_middleware'

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

faraday_middleware's People

Contributors

sferik avatar mislav avatar olleolleolle avatar imactia avatar pengwynn avatar d-m-u avatar joshk avatar onk avatar jjb avatar nbibler avatar stve avatar hone avatar grosser avatar tylerhunt avatar stefansedich avatar coderanger avatar natebarnes avatar cjford avatar knu avatar akilburge avatar nicolasleger avatar dentarg avatar pda avatar pchambino avatar petergoldstein avatar romanbsd avatar sebastianedwards avatar shishi avatar semaperepelitsa avatar timrogers avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.