【发布时间】:2020-01-15 00:48:59
【问题描述】:
我正在尝试上传 FormData,其中包括 文本、图像、pdf 等
我正在使用 axios。
Axios 调用
const sellerRegister = params => {
console.log(params);
return dispatch => {
dispatch(servicePending());
return axios
.post(`${BaseUrl}/seller/register`, params, {
headers: {
Accept: "application/json",
"Content-type": `multipart/form-data; boundary=${params._boundary}`
}
})
.then(res => {
return dispatch(sellerRegisterSuccess(res));
})
.catch(err => {
return dispatch(serviceError(err.message));
});
};
};
FormData 中的参数
服务错误
提供此错误的解决方案。并指导我这样做是否正确?
谢谢
【问题讨论】:
标签: react-native post file-upload axios content-type