使用CURL时,有两个超时时间:一个是连接超时时间,另一个是数据传输的最大允许时间。
连接超时时间用--connect-timeout参数来指定,数据传输的最大允许时间用-m参数来指定。

curl --connect-timeout 10 -m 20 "http://XXXXXXX"

连接超时的话,出错提示形如:
curl: (28) connect() timed out!
数据传输的最大允许时间超时的话,出错提示形如:
curl: (28) Operation timed out after 2000 milliseconds with 0 bytes received

 

参考:

https://www.cnblogs.com/EasonJim/p/8304927.html

相关文章:

  • 2021-12-19
  • 2021-08-19
  • 2022-02-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-03
  • 2022-12-23
  • 2022-02-14
  • 2021-10-27
  • 2021-09-20
  • 2021-11-16
  • 2022-01-12
相关资源
相似解决方案