Skip to content

Commit

Permalink
fix doc to match latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-wada committed Aug 25, 2022
1 parent b3b9229 commit fa81832
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions docs/usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,7 @@ order: 1
Let's fetch the home page for the wonderful
[httpbingo.org](https://httpbingo.org) service.

First of all, you need to tell Faraday which [`adapter`](../adapters) you wish to use.
Adapters are responsible for actually executing HTTP requests.
There are many different adapters you can choose from.
Just pick the one you like and install it, or add it to your project Gemfile.
You might want to use Faraday with the `Net::HTTP` adapter, for example.
[Learn more about Adapters](../adapters).

Remember you'll need to install the corresponding adapter gem before you'll be able to use it.

```ruby
require 'faraday'
require 'faraday/net_http'
Faraday.default_adapter = :net_http
```

Next, you can make a simple `GET` request using `Faraday.get`:
You can make a simple `GET` request using `Faraday.get`:

```ruby
response = Faraday.get('http://httpbingo.org')
Expand Down Expand Up @@ -135,6 +120,13 @@ end
# => POST http://httpbingo.org/post?limit=100
```

### Adapters

Adapters are responsible for actually executing HTTP requests. The default
adapter uses Ruby's `Net::HTTP`, but there are many different adapters
available. You might want to use Faraday with the Typhoeus adapter, for example.
[Learn more about Adapters](../adapters).

### Middleware

Under the hood, Faraday uses a Rack-inspired middleware stack for making
Expand Down

0 comments on commit fa81832

Please sign in to comment.