Skip to content

Instantly share code, notes, and snippets.

@subkitio
Last active December 26, 2015 19:50
Show Gist options
  • Save subkitio/15ef37458864f0f20425 to your computer and use it in GitHub Desktop.
Save subkitio/15ef37458864f0f20425 to your computer and use it in GitHub Desktop.
HTTP request/response
const request = require('request-promise');
request({uri: 'https://api.github.com/users/subkitio', json:true, headers: {'User-Agent':'subkit.io'}})
.then(result => this.res.send(result))
.catch(err => {
console.error(err.message);
this.res.status(500).end();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment