Skip to content

Commit

Permalink
Fix FormData example (#4391)
Browse files Browse the repository at this point in the history
You need to have form.getBuffer() in order for the FormData library to submit from node.

Co-authored-by: Jay <[email protected]>
  • Loading branch information
nickjuntilla and jasonsaayman authored Mar 7, 2022
1 parent 45cb5ad commit 3d13b67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ form.append('my_field', 'my value');
form.append('my_buffer', new Buffer(10));
form.append('my_file', fs.createReadStream('/foo/bar.jpg'));

axios.post('https://example.com', form, { headers: form.getHeaders() })
axios.post('https://example.com', form.getBuffer(), { headers: form.getHeaders() })
```

Alternatively, use an interceptor:
Expand Down

0 comments on commit 3d13b67

Please sign in to comment.