问题
Using the form-data module in node.js, you can do this
form.pipe(request)
to put the form data to the request. But how can you wait until it is complete? Is there a callback like this
form.pipe(request).done(function(err) {});
Does anyone know?
Thanks
回答1:
In the docs, they use:
form.pipe(request);
request.on('response', function(res) {
console.log(res.statusCode);
});
来源:https://stackoverflow.com/questions/46479347/how-to-wait-for-the-pipe-to-finish-in-form-data-node-js-module