Slack.Web.DefaultClient (SlackKit v1.0.0-alpha.0)

View Source

Default Slack.Web.Client implementation, built on Req.

Every call generated under Slack.Web.* is delivered as an HTTP POST. Form
bodies are sent as application/x-www-form-urlencoded; uploads are sent as
multipart/form-data with the file streamed from disk.

Responses are JSON-decoded and returned unwrapped — i.e. the caller
receives the body map directly, so successful calls and Slack-level errors
(%{"ok" => false, "error" => …}) are surfaced identically. Transport
failures raise via Req.post!/2.

Request options can be tuned globally via the :web_http_client_opts config
key:

config :slack, :web_http_client_opts,
  connect_options: [timeout: 10_000],
  receive_timeout: 10_000

For richer behaviour — retries, response wrapping, telemetry, custom error
handling — swap in a module implementing Slack.Web.Client:

config :slack, :web_http_client, MyApp.SlackClient