js post api headers how to basic auth username password code example
Example: node-fetch auth basic
// for node-fetch
fetch(url, {
...
headers: {
'Authorization': 'Basic ' + Buffer.from(`${username}:${password}`, 'binary').toString('base64')
}
...
})