Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

superagent 对个别网站发送get请求后得到ECONNRESET错误

$
0
0

我在模拟登录 https://myportal.vtc.edu.hk/wps/portal时,没有得到响应信息,过了一段时间后得到一个错误返回: code: “ECONNRESET”, errno: “ECONNRESET”, syscall: "read" 我在网上搜了很久,都没有找到具体原因和解决方法,请教各位老司机给指条明路,谢谢!

let url = 'https://myportal.vtc.edu.hk/wps/portal';
    superagent
      .get(url)
      .set({
        // Accept:'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
        // 'Accept-Encoding':'gzip, deflate, sdch, br',
        // 'Accept-Language':'zh-CN,zh;q=0.8,en;q=0.6',
        'Cache-Control':'no-cache',
        'Content-Type':'application/x-www-form-urlencoded',
        // Host:'myportal.vtc.edu.hk',
        // refer: 'http://mytag.hk/step1.php',
        // 'Upgrade-Insecure-Requests':1,
        // 'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36'
      })
      // .redirects(0)
      .end(function (err, pres) {
        if (err) {
          return res.item(err);
        }
        return res.write(pres.text);
      });

Viewing all articles
Browse latest Browse all 14821

Trending Articles