-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
How do you read binary data? #147
Comments
This is more of a stackoverflow question and not an issue or a bug you can use res.body.on('data', chunk => {
// Got a chunked buffer
}).on('end' () => {
// end of stream
}) You now also have the alternativ method to browsers fetch('some.png')
.then(res => res.buffer())
.then(console.log) |
Great answer, thanks, sorry hmm, note with 1.6.0:
gives me:
|
Yeah as documented in known differences and #51, on Node.js there isn't much point in using arrayBuffer. |
just use res.buffer(), not res.body.buffer(), as follows: |
It seems a few methods like
.blob()
are missing to do sothe idea is just making something similar to:
The text was updated successfully, but these errors were encountered: