Add more info about the configuration options

master
Milton Mazzarri 2019-03-19 13:23:08 -05:00
parent 371494644d
commit 8f3c8cab5c
No known key found for this signature in database
GPG Key ID: 9F4193F2B5A558FE
1 changed files with 19 additions and 1 deletions

View File

@ -424,12 +424,30 @@ Returns a `Hunter.Account`
Hunter uses [HTTPoison](https://hex.pm/packages/httpoison) as HTTP client layer.
HTTPoison understands a set of [HTTP options](https://hexdocs.pm/httpoison/HTTPoison.Request.html) which can be configured through Hunter configuration :
```
```elixir
config :hunter, http_options: [follow_redirect: true, hackney: [{:force_redirect, true}]]
```
will tell HTTPoison to follow redirected (301) links when calling mastodon API.
If you want to provide another API adapter, you can change the following option:
```elixir
config :hunter, hunter_api: Hunter.Api.HTTPClient
```
For example, to run local tests we use the following adapter:
```elixir
config :hunter, hunter_api: Hunter.Api.InMemory
```
Finally, you can also change the default API base url (`https://mastodon.social`):
```elixir
config :hunter, api_base_url: "https://mastodon.social"
```
## License
Hunter source code is released under Apache 2 License.