You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to use got.stream to stream a file response to writable stream, after I have information about the file type - defined in Content-Type header from the response?
I have prepared an MWE here, where I do this task with the request library as well as with got.
But when using got, the Node.js process just exists with code = 0 without any error or warnings, and the out file is just a preview and has only 33.7KB (compared to 12MB original image). Only way I've got this working was by adding on('data' handler for the got.stream, but I think this would break the backpressure for the pipeline.
Not sure whether this is a bug or intended.
Node.js version: v10.16.0
OS & version: Deepin 15.11
Checklist
I have read the documentation.
The text was updated successfully, but these errors were encountered:
Just for completion, this seems like the correct way to do this and to fix the "stuck issue", adding resume() resolves it, as proposed in #223 (comment)
What would you like to discuss?
How to use
got.stream
to stream a file response to writable stream, after I have information about the file type - defined in Content-Type header from the response?I short:
I have prepared an MWE here, where I do this task with the
request
library as well as withgot
.But when using
got
, the Node.js process just exists with code = 0 without any error or warnings, and the out file is just a preview and has only 33.7KB (compared to 12MB original image). Only way I've got this working was by addingon('data'
handler for thegot.stream
, but I think this would break the backpressure for the pipeline.Not sure whether this is a bug or intended.
Checklist
The text was updated successfully, but these errors were encountered: