📜  如何使用 fethch 发布数据 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:53.095000             🧑  作者: Mango

代码示例1
fetch('url here', {
    method: 'POST',
    headers: {'Content-Type':'application/x-www-form-urlencoded'}, // this line is important, if this content-type is not set it wont work
    body: 'foo=bar&blah=1'
});