📜  json post req 的伪造链接 - Javascript 代码示例

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

代码示例1
fetch('https://jsonplaceholder.typicode.com/posts', {
  method: 'POST',
  body: JSON.stringify({
    title: 'foo',
    body: 'bar',
    userId: 1,
  }),
  headers: {
    'Content-type': 'application/json; charset=UTF-8',
  },
})
  .then((response) => response.json())
  .then((json) => console.log(json));