Last active
March 14, 2016 21:25
-
-
Save vyo/b1fe1abc6a780ae6a120 to your computer and use it in GitHub Desktop.
short request promise test
This file contains hidden or 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
'use strict'; | |
const RequestPromise = require('request-promise'); | |
RequestPromise( { | |
uri: 'https://google.com', | |
method: 'HEAD', | |
resolveWithFullResponse: true, | |
simple: false | |
}) | |
.then( (response) => { | |
console.log(response.statusCode); | |
}) | |
.catch( (error) => { | |
console.log(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment