【发布时间】:2017-09-27 15:35:49
【问题描述】:
我必须做些什么才能完成这项工作?我已经证明 GET 成功返回,并且我收到了我期待的 res.body。
当然 x 是“未定义的”,因为对 getSometing() 的调用不会等待 requestify()
var x = getSomething();
function getSomething() {
requestify.get('url')
.then(function res) {
return(res.body);
})
.fail(function err) {
return("something happened");
});
}
【问题讨论】:
标签: javascript node.js requestify