【问题标题】:Getting ETIMEDOUT error even when axios default timeout is 0即使 axios 默认超时为 0,也会出现 ETIMEDOUT 错误
【发布时间】:2022-01-07 18:56:35
【问题描述】:

即使 axios 默认超时为 0,我也会收到 ETIMEDOUT 错误。

错误:连接 ETIMEDOUT xx.xx.x.xx:xxxx
在 TCPConnectWrap.afterConnect [as oncomplete] (net.js:1148:16) {
错误号:-110,
代码:'ETIMEDOUT',
系统调用:“连接”,
地址:'xx.xx.xx.1xxx',
端口:40112,
配置:{
网址:'xxx.com/sda/das',
方法:'发布',
数据:'{"username":"abc","password":"sADASD","environment":"das","role":"dasd"}',
标题:{
接受:'application/json, text/plain, /',
“内容类型”:“应用程序/json”,
'用户代理':'axios/0.21.4',
“内容长度”:187
},
转换请求:[[函数:转换请求]],
转换响应:[[函数:转换响应]],
超时:0,\

【问题讨论】:

    标签: node.js http https axios timeout


    【解决方案1】:

    这不是axios 错误,这是操作系统错误 - 这意味着操作系统尝试在此端口连接到此主机时超时。通常,这意味着服务器无法访问 - 至少在 Linux 上,默认超时非常大 - 大约几分钟。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-25
      • 2021-02-04
      • 2019-08-20
      • 1970-01-01
      • 1970-01-01
      • 2021-01-02
      • 1970-01-01
      相关资源
      最近更新 更多