400错误的请求,但是我的表单数据正确

时间:2019-05-13 03:57:00

标签: javascript

我正在为我的Web服务设置一个新的API,我真的不知道自己在做什么错,因为每次向端点发出发布请求时都会收到400错误的请求。

我在MDN中尝试了多种方法和教程,但是没有用

const sendSuccess = async () => {
    fetch('https://api.swiftsole.app/v1/success', {
    method: 'POST',
    body: JSON.stringify({
        userRegion:"US",
        userEmail:"mpilasco@hotmail.com",
        orderNum:"47131238",
        orderTotal:"$70.72",
        checkoutDelay:"2500"
    }),
    mode: 'no-cors',
  })
  .then(response => console.log(response))
}

这就是我在邮递员那里得到的答复,这就是我想要的

{
    "success": true,
    "post_id": "99719886"
}

0 个答案:

没有答案