Skip to content

Commit

Permalink
append a doc on how to config adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-wada committed Aug 30, 2022
1 parent fa81832 commit 22978f0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/adapters/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,28 @@ a Faraday response object. Adapters are typically implemented with common Ruby
HTTP clients, but can have custom implementations. Adapters can be configured
either globally or per Faraday Connection through the configuration block.

For example, consider using `httpclient` as an adapter. Note that [faraday-httpclient](https://github.com/lostisland/faraday-httpclient) must be installed beforehand.

If you wants to configure it globally, do the following:

```ruby
require 'faraday'
require 'faraday/httpclient'

Faraday.default_adapter = :httpclient
```

If you want to configure it per Faraday Connection, do the following:

```
require 'faraday'
require 'faraday/httpclient'
conn = Faraday.new do |f|
f.adapter :httpclient
end
```

{: .mt-60}
## Fantastic adapters and where to find them

Expand Down

0 comments on commit 22978f0

Please sign in to comment.