scratcher_hackney v0.1.0 Scratcher.Hackney

It is a module for using Hackney in the interface of Scratcher.HttpClient.

Link to this section Summary

Functions

You can specify Hackney options. Check the default value.

Link to this section Functions

Link to this function

request(method, url, body \\ "", headers \\ [], http_opts \\ [])

You can specify Hackney options. Check the default value.

# default
config :scratcher_hackney, :hackney_opts, recv_timeout: 30_000

As described in Scratcher.HttpClient, you can use it equivalently to other HTTP Clients.

config :your_module, http_client: Scratcher.Hackney
defmodule YourModule do
  @http_client Application.fetch_env!(:your_module) |> Keyword.fetch!(:http_client)

  def request(method, url, body, headers, http_opts) do
    @http_client.request(method, url, body, headers, http_opts)
  end
end