-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Piping response of POST not writing to writeStream #684
Comments
req.end(function(err, res) { fs.writeFile('test.png', res.body, function(err) { |
Bumping this dormant issue because an SO question emerged with the same problem. I've just answered it too. Basically, right now one should pipe the request object instead of the obtained response. Unless you wish to consider improving the documentation on how a response object should not be treated as a readable stream or actually making that part of the public API, this issue can be closed. |
The You can't use both |
Note that neither I nor the questions suggest doing both |
When you call The callback in If you want to send data from the |
cc #1188 |
I might be crazy, but the below code snippet does not seem work for me.
res.body
is a valid buffer and I can manually write to the stream with it, but I'm confused as to why pipe doesn't seem to be working.The text was updated successfully, but these errors were encountered: