Problem with react using FormData append failed

formData is still empty after using FormData, append in react,

    var formData = new FormData();
    formData.append("username", "Groucho");
    formData.append("accountnum", 123456);
    console.log(formData)

log

clipboard.png

have a look at it for friends who know.

Jun.20,2021

formData.forEach(v=>console.log(v))

can be traversed


Please use the FormData.get method to get it.

    var formData = new FormData();
    formData.append("username", "Groucho");
    formData.append("accountnum", 123456);
    console.log(formData.get("username")) // Groucho

if it is a safari browser, you can polyfill it. https://github.com/jimmywarti.

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