Skip to content

Commit

Permalink
Merge f8ea0fc into a1f3ce8
Browse files Browse the repository at this point in the history
  • Loading branch information
Brutalbeard committed Feb 6, 2019
2 parents a1f3ce8 + f8ea0fc commit 73356ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -985,10 +985,10 @@ var FormData = require('form-data'),
formData = new FormData();

// This is the mandatory part, the name and type should always be as follows
formData.append('json', new Buffer(JSON.stringify(body)), {filename: 'request.json', contentType: 'application/json'});
formData.append('json', Buffer(JSON.stringify(body)), {filename: 'request.json', contentType: 'application/json'});

// To send a plain text
formData.append('attachment', new Buffer('some plain text'), {filename: 'text.txt', contentType: 'text/plain'});
formData.append('attachment', Buffer('some plain text'), {filename: 'text.txt', contentType: 'text/plain'});

// To send a file from file system
formData.append('attachment', require('fs').createReadStream('/foo/bar.jpg'));
Expand Down

0 comments on commit 73356ca

Please sign in to comment.