I'm doing a GET http request for Google Civic's API, where I'm providing an address and receiving members of the U.S. government based on where the provided address is located.
//var options has the host, path, etc.
var req = https.request(options, function(res) {
console.log('STATUS: ' + res.statusCode);
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk.normalizedInput) //returns 'undefined'
});
});
chunk is printing this out:
And to my understanding, to access data in normalizedInput, I'd do chunk.normalizedInput, right? Why is it returning undefined?
