tesla v0.8.0 Tesla.Middleware.BasicAuth View Source

Basic authentication middleware

Wiki on the topic

Example:

defmodule MyClient do
  use Tesla

  def client(username, password, opts \ %{}) do
    Tesla.build_client [
      {Tesla.Middleware.BasicAuth, Map.merge(%{username: username, password: password}, opts)}
    ]
  end
end

Options:

  • :username - username (defaults to "")
  • :password - password (defaults to "")

Link to this section Summary

Link to this section Functions