From 8f3c8cab5c3451a7e7ed015604bd1a12c70a5254 Mon Sep 17 00:00:00 2001 From: Milton Mazzarri Date: Tue, 19 Mar 2019 13:23:08 -0500 Subject: [PATCH] Add more info about the configuration options --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 88cf77d..3a763f0 100644 --- a/README.md +++ b/README.md @@ -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.