Last active
December 26, 2015 19:50
-
-
Save subkitio/15ef37458864f0f20425 to your computer and use it in GitHub Desktop.
HTTP request/response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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