1. 首页
  2. 考试认证
  3. 其它
  4. request then请求与thenpromise的混搭

request then请求与thenpromise的混搭

上传者: 2024-12-10 16:25:28上传 ZIP文件 4.92KB 热度 1次

安装 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);

  });

下载地址
用户评论