最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

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

IT培训 admin 14浏览 0评论

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:[对象:空原型] {}

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

[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"
}
发布评论

评论列表 (0)

  1. 暂无评论