The title simply says it. I can not figure out how to send a a couple of fields vial multipart.
I understand that there is an implementation with https://github.com/felixge/node-form-data
I have all my fields available and would just to post it as multipart and work with the async result...
For any examples better or for me more clearer than then the one on the authors github's page (https://github.com/mikeal/request) would be fantastic...
Thanks
Have you seen the following at the end of node-form-data?
"In order to submit this form to a web application, you can use node's http client interface:"
var http = require('http');
var request = http.request({
method: 'post',
host: 'example.org',
path: '/upload',
headers: form.getHeaders()
});
form.pipe(request);
request.on('response', function(res) {
// work with the result here
console.log(res.statusCode);
});
It does exactly what you are looking for.