axios 里面默认超时时间是不是1000?

看axios的官方文档,
链接:
https://www.kancloud.cn/yunye...

发现它里面并没有说明默认超时时间是多长,之前也没注意到这个问题。文档里面只有:

clipboard.png
请问各位:axios的默认超时时间是1000吗?

阅读 33.3k
3 个回答

无语,这是哪门子官方文档?
https://github.com/axios/axios

  // `timeout` specifies the number of milliseconds before the request times out.
  // If the request takes longer than `timeout`, the request will be aborted.
  timeout: 1000, // default is `0` (no timeout)

这个超时时间是以XMLHttpRequest的默认超时时间为准的,而它的超时时间我没猜错的话,是以tcp的超时时间来算的

看英文原版文档吧
中文没翻译完整
https://github.com/axios/axios

  // `timeout` specifies the number of milliseconds before the request times out.
  // If the request takes longer than `timeout`, the request will be aborted.
  timeout: 1000, // default is `0` (no timeout)
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进