Tesla.put_opt
You're seeing just the function
put_opt
, go back to Tesla module for more information.
Specs
put_opt(Tesla.Env.t(), atom(), any()) :: Tesla.Env.t()
Adds given key/value pair to :opts
field in Tesla.Env
.
Useful when there's need to store additional middleware data in Tesla.Env
Examples
iex> %Tesla.Env{opts: []} |> Tesla.put_opt(:option, "value")
%Tesla.Env{opts: [option: "value"]}