Blob/Stream/Buffer request support?
See original GitHub issueHow to request with a binary body directly, I cannot find this in document?
For example:
// node stream
const file = fs.createReadStream('./example.png')
// node buffer
const file = fs.readFileSync('./example.png')
// browser
const file = document.querySelector('input[type=file]').files[0]
request
.post('/proxy')
.set('Content-Type', 'application/octet-stream')
.send(file)
// attach a blob/stream/buffer directly to request body like node node core http module
.end()
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (10 by maintainers)
Top Results From Across the Web
ladjs/superagent - Blob/Stream/Buffer request support?
How to request with a binary body directly, I cannot find this in document? For example: // node stream const file = fs.createReadStream('....
Read more >Blob.stream() - Web APIs - MDN Web Docs
The Blob interface's stream() method returns a ReadableStream which upon reading returns the data contained within the Blob.
Read more >Performance tuning for uploads and downloads with Azure ...
Learn how to tune your uploads and downloads for better performance with Azure Storage client library for .NET.
Read more >Buffer | Node.js v19.3.0 Documentation
arrayBuffer (); blob.size; blob.slice([start[, end[, type]]]); blob.stream() ... Node.js APIs accept plain Uint8Array s wherever Buffer s are supported as ...
Read more >Do's and Don'ts for Streaming File Uploads to Azure Blob ...
By using the multipart form-data request you can also support sending ... and BlobClient buffer into memory for uploads CloudBlockBlob blob ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks. I couldn’t get attach() to work, and actually ended up using send(), which to my surprise worked fine
The buffer was created with:
how did you used ‘application/octet-stream’ to uploading?