-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
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
[Feature Request] umi-request 好像不支持 onUploadProgress #3267
Comments
@chenjsh36 请看下。 |
onUploadProgress 事件我理解因为是 XMLHttpRequest.upload 里事件监听器中的 onprogress 事件。很遗憾,umi-request 是基于 fetch 而非 XMLHttpRequest 封装的请求库,本身并不支持 onUploadProgress、onDownloadProgress 这类原生能力。 为什么 umi-request 不选择 XMLHttpRequest ,具体的原因和讨论可以看传统 Ajax 已死,Fetch 永生,简单来说,相比设计粗糙、不关注分离、调用方式混乱的 XMLHttpRequest,我们选择了语法简洁、基于标准 Promise 实现的 Fetch ,在享用 fetch 带来的好处的同时,也接受了 fetch 带来的不足之处。 |
好像网上有 fetch 模拟 process 的实现 https://jakearchibald.com/2016/streams-ftw/ |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
早知道我就用回原生的axios,失望 |
Background
不知道是 bug 还是 feature 。没有找到支持 onUploadProgress 事件的说明
Proposal
Additional context
The text was updated successfully, but these errors were encountered: