Skip to content

Commit

Permalink
readme: document basic auth usage
Browse files Browse the repository at this point in the history
Fixes: #57
  • Loading branch information
feross committed Nov 18, 2020
1 parent a0fe9a3 commit 81eaf56
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -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
Expand Down

0 comments on commit 81eaf56

Please sign in to comment.