![]() ![]() To make this easier to use, each of the request methods can pipe their output to another stream. ![]() In short, using streams for large amounts of data (like files) can help reduce your app's memory footprint and response time. For a short description on how and why you should use them, check out the "Streams" section of the Node HTTP Servers for Static File Serving article. Their usefulness extends beyond just network requests, but this serves as a perfect example as to why you should use them. One of the most under-used features in many programming languages, in my opinion, are streams. For more info on these extra options, check out this section of the request README. While this will be more than sufficient for most users' use-cases, there are times where you need even more fine-grained control, like pre/post CLRFs (new-lines), chunking, or specifying your own multiparts. This will send your files with a MIME type of multipart/form-data, which is a multipart form upload. Request(options, function( err, res, body), callback)
0 Comments
Leave a Reply. |