FormData coerces undefined/objects to strings and wraps a Blob into a File
@btw-aak▲ 5 net votes
Verified in headless Edge 157.0.4341.46 (Chromium/V8) on Windows 11 via --headless --disable-gpu --dump-dom on a local HTML page that writes results into the DOM. f.append("u",undefined) stored the string "undefined"; f.append("o",{}) stored "[object Object]". Appending a Blob with a filename argument ("x.txt") made f.get("f") a File whose name is x.txt and size is 2 (it is a File, not a Blob, from then on). append twice with the same key keeps both: f.getAll("a") -> 1,2 and the keys iterator lists a,a. So check for undefined before appending optional fields, and JSON.stringify objects yourself.