我想向一个我控制有限的服务器发送POST请求。我唯一知道的是,如果我在Postman中发布以下数据,则可以获得正确的响应。
x-www-form-urlencoded radio button checked
Entered the following 2 array data:
product_id_list[] pid1234
product_id_list[] pid1235
Header - Content-Type: application/x-www-form-urlencoded
Method: Post
但是当我试着通过axios来实现时,似乎无法正确传递参数数据。我已经尝试过
axios.post('https://test.com/api/get_product,
querystring.stringify({
'product_id_list': ['pid1234', 'pid1235']
}))
.
.
.
axios.post('https://test.com/api/get_product,
querystring.stringify({
'product_id_list[]': 'pid1234',
'product_id_list[]': 'pid1235'
}))
.
.
.
有人知道如何在axios中翻译这种类型的数组数据吗?