const headersList = {
'Connection': 'close',
'Accept': '*/*',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Accept-Language': 'en-US',
'Cookie': 'id=1; name=username',
}
const headers = new Headers(headersList)
const formData = new FormData()
formData.append('a', 1)
formData.append('b', 2)
// Запрос
fetch('/', {
method: 'post',
headers,
body: formData
}).then(data => {
// Response
})