Skip to content

Instantly share code, notes, and snippets.

@mosampaio
Created August 22, 2016 17:06
Show Gist options
  • Save mosampaio/bd9d9be05df97794c3077df559885df3 to your computer and use it in GitHub Desktop.
Save mosampaio/bd9d9be05df97794c3077df559885df3 to your computer and use it in GitHub Desktop.
How to consume a json Rest API with Node.js using Unirest
// Remember to install the dependency> npm install unirest
const unirest = require('unirest');
unirest.get('https://api.github.com/repos/twilio/twilio-node/contributors')
.headers({'user-agent': 'My App'})
.end((response) => {
console.log(response.body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment