The format of transmitting parameters in application/x-www-form-urlencoded for axios is incorrect.

use axios to pass parameters. The initial request header is passed in json format without adding format. The backend says that if formdata is needed, add

to axios.
axios.defaults.headers = {
"Content-Type": "application/x-www-form-urlencoded"
}
function fetch(url, params) {
  return new Promise((resolve, reject) => {
      
    axios.post(url, params)
      .then(response => {
        resolve(response.data);
      })
      .catch((error) => {
        reject(error);
      })
  })
}

pass the parameter format as let content = {openid:openid}; then pass content as an argument to the fetch method
, but the format passed is formdata but still looks like a string (not well understood)

clipboard.png

clipboard.png

Sorry for being a little incoherent. Please do me a favor.

Mar.03,2021

https://github.com/axios/axio.


the backend should be able to receive it. The default is axios.defaults.headers.post ['Content-Type'] =' application/x-www-form-urlencoded';

.
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-1c1de49-483ef.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-1c1de49-483ef.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?