【问题标题】:I created a blockchain api and ran it, I verified it in postman and it's working fine but while parsing the body its giving me numerous errors我创建了一个区块链 api 并运行它,我在邮递员中对其进行了验证,它工作正常,但是在解析主体时它给了我很多错误
【发布时间】:2020-12-18 16:21:13
【问题描述】:

【问题讨论】:

  • 请编辑您的问题并添加 code-sn-ps 而不是图像。

标签: json express npm


【解决方案1】:

在您的'transactions'-handler 中,您调用了两次res.send()。您只能执行一次,因此将其更改为例如

app.post('/transactions', (req,res) => {
    res.send(`The amount ... is ${req.body.amount}...`);
})

【讨论】:

  • 是的,非常感谢。现在一切正常。
  • 乐于提供帮助,请确保不要忘记接受答案。谢谢:)
猜你喜欢
  • 1970-01-01
  • 2013-02-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-07-21
  • 2022-01-16
  • 1970-01-01
  • 2020-02-28
相关资源
最近更新 更多