How to send a file in request node-fetch or Node?
问题 How do I attach a file in Node or Node Fetch POST request? I am trying to invoke an API which will import a CSV or XLS file. Is this possible using Node or Node Fetch? 回答1: README.md says: Use native stream for body, on both request and response. And sources indicate it supports several types, like Stream , Buffer , Blob ... and also will try to coerce as String for other types. Below snippet shows 3 examples, all work, with v1.7.1 or 2.0.0-alpha5 (see also other example further down with