Reputation: 1088
While using an API I am getting undefined
rather then the status code like 200 or 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');
});
Upvotes: 0
Views: 1992
Reputation: 13669
it should be : response.statusCode
const req = https.request(options, (response) => {
console.log('statusCode:', response.statusCode);
});
Upvotes: 1