content/flux/v0/stdlib/http/basicauth.md
http.basicAuth() returns a Base64-encoded basic authentication header
using a specified username and password combination.
(p: string, u: string) => string
{{% caption %}} For more information, see Function type signatures. {{% /caption %}}
({{< req >}}) Username to use in the basic authentication header.
({{< req >}}) Password to use in the basic authentication header.
import "http"
username = "myawesomeuser"
password = "mySupErSecRetPasSW0rD"
http.post(
url: "http://myawesomesite.com/api/",
headers: {Authorization: http.basicAuth(u: username, p: password)},
data: bytes(v: "Something I want to send."),
)