We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
优势: 1.更加底层,提供的API丰富(request, response) 2.脱离了XHR,是ES规范里新的实现方式
不足: 1.fetch只对网络请求报错,对400,500都当做成功的请求,需要封装去处理 2.fetch默认不会带cookie,需要添加配置项 3.fetch不支持abort,不支持超时控制,使用setTimeout及Promise.reject的实现的超时控制并不能阻止请求过程继续在后台运行,造成了流量的浪费 4.fetch没有办法原生监测请求的进度,而XHR可以
[资料]: 传统 Ajax 已死,Fetch 永生 fetch 没有你想象的那么美
封装: 让fetch也可以timeout
The text was updated successfully, but these errors were encountered:
No branches or pull requests
优势:
1.更加底层,提供的API丰富(request, response)
2.脱离了XHR,是ES规范里新的实现方式
不足:
1.fetch只对网络请求报错,对400,500都当做成功的请求,需要封装去处理
2.fetch默认不会带cookie,需要添加配置项
3.fetch不支持abort,不支持超时控制,使用setTimeout及Promise.reject的实现的超时控制并不能阻止请求过程继续在后台运行,造成了流量的浪费
4.fetch没有办法原生监测请求的进度,而XHR可以
[资料]:
传统 Ajax 已死,Fetch 永生
fetch 没有你想象的那么美
封装:
让fetch也可以timeout
The text was updated successfully, but these errors were encountered: