const formdata = new FormData(event.target); formdata.append('userid', 'jeff'); formdata.append('password', 'amazon');
const query = new URLSearchParams(formdata).toString(); console.log('query=' + query);Will log
userid=jeff&password=amazonYou cannot do this for files in a FormData.