小编Yah*_*hya的帖子

如何在 Express.js 中访问 post 请求的原始正文?

我用邮递员发送了这个请求。

邮差

console.log(req.body)返回一个这样的数组:

{ '{"urls":["https://example.com?paramOne': 'foo',
  paramTwo: 'bar"]}' }
Run Code Online (Sandbox Code Playgroud)

如何将整个身体作为这样的简单字符串?

{"urls":["https://example.com?paramOne=foo&paramTwo=bar"]}
Run Code Online (Sandbox Code Playgroud)

express postman body-parser

2
推荐指数
1
解决办法
3752
查看次数

标签 统计

body-parser ×1

express ×1

postman ×1