function sendData(url, data) {
const formData = new FormData();
for (let name in data) {
formData.append(name, data[name]);
}
fetch(url, {
method: 'POST',
body: formData
}).then(function (response) {
...
});
}
Last active
September 14, 2018 14:43
-
-
Save jpbecotte/79ca77d399e42ba14436d9d22be78e70 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment