Closed alessioalex closed 3 years ago
I wonder if this could be documented in the README like the oauth technique is (without adding code).
Maybe something like:
const user = 'someuser'
const pass = 'pa$$word'
const encodedAuth = Buffer.from(`${user}:${pass}`).toString('base64')
get('http://example.com', {
headers: {
'user-agent': `my-module/${pkg.version} (https://github.com/username/my-module)`,
authorization: `Basic ${encodedAuth}`
}
})
Did not see that at the time I posted this. Considering that's the approach for OAuth, the http auth should be like the one in @Flet 's example (included in the README
).
Thanks for the code snippet, @Flet. Just added it to the readme!
Hey @feross would you be open to a pull request to support basic auth? I know there's already OAuth but basic auth is still used here and there.