Last active
January 2, 2016 03:29
-
-
Save bryanbarnard/8243762 to your computer and use it in GitHub Desktop.
Node Make HTTP Request using proxy
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
//make use of proxy package to make calls | |
var request = require('request'); | |
var r = request.defaults({'proxy':'http://127.0.0.1:8888'}) | |
r('https://demo003.service-now.com/stats.do', function (error, response, body) { | |
if (!error && response.statusCode == 200) { | |
console.log(body) // Print the body of the response | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment