The difference between the two forms of FormData data requested by http

send a post request with axios and send data using FormData in the format

jQuery

what"s the difference between the two? Because the first response is true, but it doesn"t seem to have been deleted yet!

export const delHandBook= params => {
    return axios.post(`${base}/fileManage/deleteHandBook`, params, {headers: {"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"}}).then(res => res.data);
};
Mar.07,2021

what's the difference between payload and formData?


one is passed as is, and the other is passed after url encoding, corresponding to multipart/form-data and urlencode


, respectively.

you send the value of formData directly in axios, which is what you look like in figure 1. The failure to delete is due to the fact that your backend did not properly handle the data you submitted in the past.

if you want to use formData and the data passed is figure 2, you can use URLSearchParams to wrap it (if any, the file will be dropped by Filter)

   

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b32aa2-341e0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b32aa2-341e0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?