Authenticated HTTP requests
Mix.install([
{:req, "~> 0.4.0"}
])
Making GET request with the req library
req =
Req.new(
base_url: "https://api.github.com/users/1-bit-wonder",
headers: %{
authorization: "bearer " <> System.fetch_env!("LB_GITHUB_TOKEN"),
accept: "application/vnd.github+json"
}
)
{:ok, res} = Req.get(req)