Created
April 10, 2013 19:01
-
-
Save imjacobclark/5357456 to your computer and use it in GitHub Desktop.
Returns weird issue 'problem with request: getaddrinfo ENOTFOUND'
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
var https = require('https'); | |
var options = { | |
host: 'httpss://stream.twitter.com/1.1/statuses/filter.json?', | |
path: 'track=bieber', | |
method: 'GET', | |
headers: { | |
"Authorization": "OAuth", | |
"oauth_consumer_key": "", | |
"oauth_nonce": "", | |
"oauth_signature": "%3D", | |
"oauth_signature_method": "HMAC-SHA1", | |
"oauth_timestamp": "", | |
"oauth_token": "", | |
"oauth_version": "1.0" | |
} | |
}; | |
var req = https.request(options, function(res) { | |
console.log('STATUS: ' + res.statusCode); | |
console.log('HEADERS: ' + JSON.stringify(res.headers)); | |
res.setEncoding('utf8'); | |
res.on('data', function (chunk) { | |
console.log('BODY: ' + chunk); | |
}); | |
}); | |
req.on('error', function(e) { | |
console.log('problem with request: ' + e.message); | |
}); | |
// write data to request body | |
req.write('data\n'); | |
req.write('data\n'); | |
req.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment