Authenticate Req Requests with Basic Auth
Req has a built-in for handling some auth mechanisms, such as Basic Auth, Bearer, and netrc.
You can send the auth as a tuple, where the first element is the type and the second is the credential -
Req.post("https://example.com", json %{foo: "bar"}, auth: {:basic, "user:password"})
https://hexdocs.pm/req/Req.Steps.html#auth/1
Tweet