-
-
Notifications
You must be signed in to change notification settings - Fork 938
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
uploadProgress
for non-stream bodies
#1735
Comments
Indeed, this regressed in Got 11. A workaround is to set body to |
Unfortunately |
This will result in duplicated data though. If you send a 1MB Buffer then Got will store it twice - in the stream and in the options so you can inspect it for debugging. |
@sindresorhus Maybe let's enable progress callbacks for Stream API and stream bodies only? HTTP/1 streams are not real streams, so we cannot read |
If |
uploadProgress
for non-stream bodies
I agree. |
While You have to do it manually and it will result in duplicated data. |
Describe the bug
I'm sending a POST request to a server with a large string as the body, and would like to get granular progress events as it sends. However, the on('uploadProgress') listener only seems to fire at the start and end of the request, and never mid-transit. I got the impression from #322 that a workaround was implemented to make this work, but I can't seem to achieve this. If something else is needed from my code to make it work, it would be nice to see more clarification in the documentation.
v14.17.0
macOS Big Sur 11.2.3
Actual behavior
Expected behavior
Code to reproduce
Checklist
The text was updated successfully, but these errors were encountered: