📌  相关文章
📜  fetch x-www-form-urlencoded - 任何代码示例

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

代码示例1
fetch('https://example.com/login', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  body: new URLSearchParams({
    'param': 'Some value',
    'another_param': 'Another value'
  })
})
  .then(res => {
    // Do stuff with the result
  });