Telegramex.HTTPClient behaviour (Telegramex v0.1.0) View Source

Specifies the behaviour of a HTTP Client.

You can switch the default HTTP client which uses finch underneath by defining a different implementation by setting the :http_client configuration in Telegramex.Client:

client = %Telegramex.Client{http_client: {MyCustomHTTPClient, []}}
Telegramex.get_updates(client)

Link to this section Summary

Link to this section Functions

Link to this function

request(method, url, headers, body, opts)

View Source

Link to this section Callbacks

Link to this callback

request(method, url, headers, body, opts)

View Source

Specs

request(
  method :: atom(),
  url :: binary(),
  headers :: list(),
  body :: iodata(),
  opts :: Keyword.t()
) ::
  {:ok, %{status: integer(), headers: [{binary(), binary()}], body: binary()}}
  | {:error, term()}

Sends an HTTP request.