Javascript 使用API时未定义response.status代码

Javascript 使用API时未定义response.status代码,javascript,html,node.js,api,http-status-codes,Javascript,Html,Node.js,Api,Http Status Codes,使用API时,我得到的是未定义的,而不是像200或404这样的状态代码 app.get('/', function(req, res){ const url = ''; //The API key https.get(url, function(response){ console.log(response.statuscode); }); res.send('App is running'); }); 它应该是:response.stat

使用API时,我得到的是
未定义的
,而不是像200或404这样的状态代码

app.get('/', function(req, res){

    const url = ''; //The API key

    https.get(url, function(response){

        console.log(response.statuscode);
    });
    res.send('App is running');
});

它应该是:
response.statusCode

const req = https.request(options, (response) => {
  console.log('statusCode:', response.statusCode);
});

由于打字错误引起的标记。