Skip to content

Instantly share code, notes, and snippets.

@sankalpk
Created September 8, 2016 17:20
Show Gist options
  • Save sankalpk/1c61789c12061d46ac3751078cb0a486 to your computer and use it in GitHub Desktop.
Save sankalpk/1c61789c12061d46ac3751078cb0a486 to your computer and use it in GitHub Desktop.
OAuth make simple request
var request = require('request');
var accessToken = 'ACCESS_TOKEN_HERE';
request({
url: 'https://api.someapi.com/blah/something',
auth: {
'bearer': accessToken
}
}, function(err, res) {
console.log(res.body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment