agraboso / agraboso/redux-api-middleware
how to send multipart/form-data
- 主要语言
- JavaScript
- 星标
- 1.5k
- 派生
- 190
- PR 合并指标
- 30 天内没有已合并 PR
描述
I'm trying to send file selected by the react-dropzone but I couldn't accomplish this. In some cases call_api is doing nothing no request / no error and in some cases request is sent but without mutlipart info and my server throws exception
` the request was rejected because no multipart boundary was found]`
the code which I think is correct with your documentation is bellow
`
let test = (files) => {
let formData = new FormData();
formData.append('file', files[0]);
return {
[CALL_API]: {
types: [UPLOAD_BEGIN, UPLOAD_SUCCESS, UPLOAD_FAILURE],
endpoint: '/report/RIF/definition',
method: 'post',
headers: {'Content-Type': 'multipart/form-data'},
body: formData
},
}
};`
贡献指南
评估
这个 Issue 还没有评估数据。