📅  最后修改于: 2022-03-11 15:04:08.384000             🧑  作者: Mango
const axios = require('axios');
const FormData = require('form-data');
const form = new FormData();
// Second argument can take Buffer or Stream (lazily read during the request) too.
// Third argument is filename if you want to simulate a file upload. Otherwise omit.
form.append('field', 'a,b,c', 'blah.csv');
axios.post('http://example.org/endpoint', form, {
headers: form.getHeaders(),
}).then(result => {
// Handle result…
console.log(result.data);
});