request then请求与thenpromise的混搭
安装 request-then:
使用命令:
npm install request-then --save
示例代码:
var request = require('request-then');
request('http://example.com')
.then(function handleResponse(response) {
console.log(response);
}, function handleError(error) {
console.log(error);
});
下载地址
用户评论