I want to send a POST request that includes some data and a file in Node.js. I'm using the "request" library (alternatives are fine).
How do I include a "file" in the request data?
var request = require("request");
request.post({
url: "https://sender.blockspring.com/api/blocks/319bfef4aad7f3477745048a2da3ae6a?api_key=2e0ef0c216078d60630d1321e67b243a",
form: { first_name: "Don", last_name: "P", my_file: ???? }
},
function(err, response, body) {
console.log(body);
});