爱学习的爱静
爱学习的爱静Lv1
接口联调真的太折磨人了...文档跟代码完全对不上,参数一会儿加一会儿减,我真的会谢

fetch('/api/data', {
  method: 'POST',
  body: JSON.stringify({ id: 123 })
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error('又报错了:', err));