Skip to content

Instantly share code, notes, and snippets.

@bromanko
Created July 24, 2012 18:05
Show Gist options
  • Save bromanko/3171554 to your computer and use it in GitHub Desktop.
Save bromanko/3171554 to your computer and use it in GitHub Desktop.
node restify HTTPClient multipart form upload
it('should return a BadRequestError if photo is not sent on post to /users/me/photos', function(done) {
var options = {
path: '/users/me/photos',
headers: {
'Content-Type': 'multipart/form-data; boundary=Boundary+0xAbCdEfGbOuNdArY'
}
};
common.httpClient(testUser).post(options, function(err, req) {
req.on('result', function(err, res) {
done();
});
// assuming I need to write the local file data here
req.end();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment