Im new to node.js and consuming apis, I'm trying to access the returned 'access_token' but when I do res.access_token I get an undefined...any idea what I should be doing?
My node.js file
const https = require("https");
const options = {
    method: 'POST',
    host : 'api.com',
    path: '/oauth2/token'
        +'?grant_type=client_credentials'
        +'&client_id=*******'
        +'&client_secret=***********',
    headers:
    {
     'cache-control': 'no-cache',
      Flow: 'application',
    }
  };
const req = https.request(options, res => {
    console.log(`statusCode: ${res.statusCode}`)
    res.on('data', d => {
      process.stdout.write(d)
    })
})
req.on('error', error => {
    console.error(error)
})
req.end()
Which returns the following
statusCode: 200
{"access_token":"********","token_type":"Bearer","expires_in":7199}
 
    