Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
560 views
in Technique[技术] by (71.8m points)

关于axios请求超时的疑惑

1:axios的timeout时间从什么时候开始计算
2:axios请求如果触发到后端,但是由于后端运行时间大于timeout设置的值,是否会触发timeout事件


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

从客户端请求发送出去开始计算,如果是后段运行时间超过timeout设置的时间,客户端也会触发timout事件,请求也会中断。所以对于耗时比较长的接口,建议增加超时时间。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...