📅  最后修改于: 2022-03-11 15:02:41.378000             🧑  作者: Mango
/**
* Package that needed:
* 'qs', 'axios'
* install by `npm install qs --save
*/
// You can Add more to this
let headers = {
'content-type': 'application/x-www-form-urlencoded',
};
let body = {
field1: 'foo',
field2: 'bar',
};
// For async_await
let reponse = await axios({
method: 'POST',
headers: headers,
data: qs.stringify(body), // <---- This step it is important
url: `${YOUR_URL}`,
});
return response['data'];