When I sent this simple API request-promise call, I don't get any response. Can someone please tell me why this isn't working?
var request = require('request-promise');
var options = {
uri: 'https://jsonplaceholder.typicode.com/todos/1',
headers: {
'User-Agent': 'Request-Promise'
},
json: true
};
request(options)
.then(function (success) {
console.log(success);
})
.catch(function (error) {
console.log('noob!');
})
It goes to the "request(options)" line, skips over BOTH the success and failure, and just exits out of the program. What gives?!