diff --git a/README.md b/README.md index 0fecf37..359cb47 100644 --- a/README.md +++ b/README.md @@ -254,6 +254,20 @@ const opts = { get(opts, function (err, res) {}) ``` +### Basic Auth + +```js +const user = 'someuser' +const pass = 'pa$$word' +const encodedAuth = Buffer.from(`${user}:${pass}`).toString('base64') + +get('http://example.com', { + headers: { + authorization: `Basic ${encodedAuth}` + } +}) +``` + ### OAuth You can use the [`oauth-1.0a`](https://github.com/ddo/oauth-1.0a) module to create