Express和nodeJS:[对象:空原型] {}

编程入门 行业动态 更新时间:2024-10-11 13:19:05

Express和nodeJS:[对象:空<a href=https://www.elefans.com/category/jswz/34/1768167.html style=原型] {}"/>

Express和nodeJS:[对象:空原型] {}

我有这个问题,当我在服务器中收到请求时,响应为:

[Object: null prototype] { '{"someParameter": "potatoParameterValue", "someOtherParameter": "otherPotatoParameter}': '' }

我已经使用过

api.use(bodyParser.urlencoded({ extended: false }));
api.use(bodyParser.json());

并且不起作用,其他人也遇到了同样的问题?

回答如下:

让我尝试快速球,不妨提供更多信息。。

看来您可能在otherPotatoParameter之后缺少“。现在对象中的键是对象。。

{ 
'{"someParameter": "potatoParameterValue", "someOtherParameter": "otherPotatoParameter}': '' 
}

也许应该是这样吗?

{
  "someParameter": "potatoParameterValue", 
  "someOtherParameter": "otherPotatoParamete"
}

更多推荐

Express和nodeJS:[对象:空原型] {}

本文发布于:2024-05-07 01:04:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1754038.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:原型   对象   Express   nodeJS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!