-
Notifications
You must be signed in to change notification settings - Fork 287
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
Fetch - POST - use stream as body? #4126
Comments
@preveen-stack, not sure what you meant exactly. It's possible to use stream with http module as explained here: https://stackoverflow.com/a/64002066, but I wonder if it's possible with fetch(). |
const fileStream = fs.createReadStream('/path/to/large/file.wav); fetch('https://example.com/api', { Can you check this code? |
Hi @preveen-stack, this code doesn't work (for instance require('node-fetch') can't work since it's a pure ESM module), and my point is to use the native "fetch" module and not the tier-party module "node-fetch" to do that. |
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. |
I'm also interested in this feature. Chromium supports something similar, so this is not without a precedent. |
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. |
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. |
Details
Hi guys,
Related to this post #4118, is there a way to use a readable stream as body of POST (or PUT) request, to avoid memory issues with large files?
Thanks
Node.js version
v18
Example code
No response
Operating system
windows/mac
Scope
code
Module and version
Not applicable.
The text was updated successfully, but these errors were encountered: