📜  如何在javascript代码示例中将对象直接传递给formdata

📅  最后修改于: 2022-03-11 15:02:36.409000             🧑  作者: Mango

代码示例1
function getFormData(object) {
    const formData = new FormData();
    Object.keys(object).forEach(key => formData.append(key, object[key]));
    return formData;
}