-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Can't post FormData since Axios 0.25.0 #4406
Copy link
Copy link
Closed
Description
Describe the issue
I can't post FormData since "axios": "^0.25.0",
Error: Request failed with status code 400
Example Code
export const client = axios.create({
baseURL: URL_API,
withCredentials: true,
responseType: 'json',
timeout: 30000,
});
const params = new FormData();
params.append('name', data.model);
params.append('idFuel', data.idFuel);
params.append('power', data.idPower);
client.post(`/app/society/${idSociety}/vehicle`, params, { headers: { "Content-Type": "multipart/form-data" } })Expected behavior, if applicable
That it works
Environment
- Axios Version: 0.25.0
- Node.js Version: v14.17.6
- OS: iOS 15, Android 11 (But on all platforms and versions)
- Additional Library Versions: React Native 0.64.3
Additional context/Screenshots
No problem with "axios": "^0.24.0",
I saw this PR #3757 on 0.25.0, but I don't know what I have to change in code.
Thanks for your help 👍
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels