Access data in JSON format
<p>I'm doing a <code>GET</code> 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. </p>

<pre><code>//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'
  });
});
</code></pre>

<p><code>chunk</code> is printing this out:</p>

<p><a href="https://i.stack.imgur.com/2hJ8j.png" rel="nofollow"><img src="https://i.stack.imgur.com/2hJ8j.png" alt="enter image description here"></a></p>

<p>And to my understanding, to access data in <code>normalizedInput</code>, I'd do <code>chunk.normalizedInput</code>, right? Why is it returning undefined?</p>