如何使用axios进行批处理请求:
我有以下批量请求
POST /batch HTTP/1.1
Content-Type: multipart/mixed; boundary=====1340674896===
--====1340674896===
GET /contacts/479038 HTTP/1.1
Content-Type: application/json
--====1340674896===
GET /contacts/299430 HTTP/1.1
Content-Type: application/json
--====1340674896===--
如何使用axios获得响应:我正在尝试以下
const config = {
headers: {
'content-type': 'multipart/mixed; boundary=====1340674896==='
}
}
axios.post('/batch',data,config)
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
如何传递
的数据 --====1340674896===
GET /contacts/479038 HTTP/1.1
Content-Type: application/json
--====1340674896===
GET /contacts/299430 HTTP/1.1
Content-Type: application/json
--====1340674896===--