📜  在 fetch 中提交表单数据 - Javascript 代码示例

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

代码示例1
// Build formData object.
let formData = new FormData();
formData.append('name', 'John');
formData.append('password', 'John123');

fetch("api/SampleData",
    {
        body: formData,
        method: "post"
    });