I am using formData with axios in my react frontend app in order to set the file using post method. But, the data that I sent to the backend rest app is getting empty.
const formData = new FormData();
//setting the file upload value from state variable
formData.append("file", file);
Axios.post(url, formData, { headers: { 'Content-Type': 'multipart/form-data'}}).then(res => console.log(res))