Open jamesmgg opened 8 years ago
Same here. In the console i get a {state: 'pending'} message, but I'm not able to get the 'then' function to run.
I ended up using superagent. Works like a charm.
One thing you might do better is always catch your promises.
requestify.get(MY_URL).then(function(response) {
console.log(response.getCode())
res.send(response)
// response.getBody();
}).catch(function(err){
console.log('Requestify Error', err);
next(err);
});
This will allow you to capture the error from the promise.
requestify automatically sets Content-Type to JSON. Make sure to change that.