Skip to content

Instantly share code, notes, and snippets.

@imjacobclark
Created April 10, 2013 19:01
Show Gist options
  • Save imjacobclark/5357456 to your computer and use it in GitHub Desktop.
Save imjacobclark/5357456 to your computer and use it in GitHub Desktop.
Returns weird issue 'problem with request: getaddrinfo ENOTFOUND'
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