Skip to content

Commit

Permalink
Explain Absolute path behaviour in README (#977)
Browse files Browse the repository at this point in the history
Updates the REAME to explain how the absolute path overrides the one provided while initialising the connection.
Fixes #976
  • Loading branch information
iMacTia committed May 12, 2019
1 parent 3abe9d1 commit a217471
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -45,8 +45,11 @@ stack and default adapter (see [Faraday::RackBuilder#initialize](https://github.
A more flexible way to use Faraday is to start with a Connection object. If you want to keep the same defaults, you can use this syntax:

```ruby
conn = Faraday.new(:url => 'http://www.example.com')
response = conn.get '/users' # GET http://www.example.com/users'
conn = Faraday.new(:url => 'http://www.example.com/api')
response = conn.get 'users' # GET http://www.example.com/api/users'

# You can override the path from the connection initializer by using an absolute path
response = conn.get '/users' # GET http://www.example.com/users'
```

Connections can also take an options hash as a parameter or be configured by using a block. Checkout the section called [Advanced middleware usage](#advanced-middleware-usage) for more details about how to use this block for configurations.
Expand Down

0 comments on commit a217471

Please sign in to comment.