Note that I'm trying to upload from the meteor/node server. I'm trying to interface with EchoSign REST API. To do this I have to upload a pdf from my server to theirs using multipart POST. I've already figured out how to do a normal POST to a server using just node.
If possible, I'd like to do this without using any extra modules besides the standard node modules like fs & http.
Here's my code so far:
var http = require('http');
options = {
host: 'localhost',
port:8080,
path: '/upload',
method: 'POST',
};
var callback = function(response) {
response.setEncoding('utf-8');
var responseString = '';
response.on('data', function(data) {
responseString += data;
});
response.on('end', function() {
console.log(responseString);
});
}
var request = http.request(options, callback);
request.on('error', function(e) {
console.log('There was an error: '+e);
});
request.end();
Can anyone point me in the right direction?