FormData is choking the server

This commit is contained in:
mmcwilliams 2017-11-21 16:55:44 -05:00
parent 58d173da75
commit 5ea31a7050
1 changed files with 2 additions and 4 deletions

View File

@ -410,13 +410,11 @@
}
};
web.setDir = function () {
const dir = document.getElementById('dir').checked;
const formData = new FormData()
const dir = !document.getElementById('dir').checked;
console.log('set to => ' + dir)
formData.append('json', JSON.stringify({ dir : dir }))
const opts = {
method : 'POST',
body : formData
body : JSON.stringify({ dir : dir })
};
console.dir(opts)
fetch('/dir', opts)