function main() { (async () => { try { const response = await fetch('/cms/api/csv/upload', createFetchPostData()); const json = await response.json(); console.log(json); } catch (error) { console.log(error); } })(); } function createFetchPostData(data = {}) { return { method: 'POST', // *GET, POST, PUT, DELETE, etc. mode: 'cors', // no-cors, cors, *same-origin cache: 'no-cache', // *default, no-ca