ExBankID.Http.Client behaviour (ex_bank_id v0.2.2) View Source

The expected behaviour an http client

You can provide your own http client by creating a module that implements this behaviour. Things to consider:

  1. The HTTP method must be POST.
  2. cert_file will be the path to a pem file used to authenticate with the BankID API. Corresponds to certfile

The default implementation can be found in ExBankID.Http.Default

Link to this section Summary

Link to this section Callbacks

Link to this callback

post(url, req_body, headers, cert_file, http_opts)

View Source

Specs

post(
  url :: binary(),
  req_body :: binary(),
  headers :: [{binary(), binary()}, ...],
  cert_file :: String.t(),
  http_opts :: term()
) :: {:ok, ExBankID.Http.Response.t()} | {:error, String.t()}