Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

FormData to json

var object = {};
formData.forEach(function(value, key){
    object[key] = value;
});
var json = JSON.stringify(object);

// Or ES6 arrow function
var object = {};
formData.forEach((value, key) => object[key] = value);
var json = JSON.stringify(object);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #FormData #json
ADD COMMENT
Topic
Name
3+2 =