Skip to content

Instantly share code, notes, and snippets.

@bryanbarnard
Last active January 2, 2016 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryanbarnard/8243762 to your computer and use it in GitHub Desktop.
Save bryanbarnard/8243762 to your computer and use it in GitHub Desktop.
Node Make HTTP Request using proxy
//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