Faraday
Faraday is an HTTP client library that provides a common interface over many adapters (such as Net::HTTP) and embraces the concept of Rack middleware when processing the request/response cycle.
Faraday supports these adapters out of the box:
Adapters are slowly being moved into their own gems, or bundled with HTTP clients. Here is the list of known external adapters:
It also includes a Rack adapter for hitting loaded Rack applications through Rack::Test, and a Test adapter for stubbing requests by hand.
Authentication
Basic and Token authentication are handled by Faraday::Request::BasicAuthentication and Faraday::Request::TokenAuthentication respectively. These can be added as middleware manually or through the helper methods.
Faraday.new(...) do |conn|
conn.basic_auth('username', 'password')
end
Faraday.new(...) do |conn|
conn.token_auth('authentication-token')
end
Supported Ruby versions
This library aims to support and is tested against the following Ruby implementations:
- Ruby 2.3+
If something doesn't work on one of these Ruby versions, it's a bug.
This library may inadvertently work (or seem to work) on other Ruby implementations and versions, however support will only be provided for the versions listed above.
If you would like this library to support another Ruby version, you may volunteer to be a maintainer. Being a maintainer entails making sure all tests run and pass on that implementation. When something breaks on your implementation, you will be responsible for providing patches in a timely fashion. If critical issues for a particular implementation exist at the time of a major release, support for that Ruby version may be dropped.
Contribute
Do you want to contribute to Faraday?
Open the issues page and check for the help wanted
label!
But before you start coding, please read our Contributing Guide
Copyright
Copyright (c) 2009-2019 Rick Olson, Zack Hobson. See LICENSE for details.