因为支付回调返回的数据格式为XML数据格式,需要安装组件body-parser-xml

 

安装语法:   npm install body-parser-xml --save

 

在app.js 文件中引入该模块  require('body-parser-xml')(bodyParser);

使用中间件:

app.use(bodyParser.xml({
  limit: '2MB',   // Reject payload bigger than 1 MB
  xmlParseOptions: {
    normalize: true,     // Trim whitespace inside text nodes
    normalizeTags: true, // Transform tags to lowercase
    explicitArray: false // Only put nodes in array if >1
  }
}));

 

相关文章:

  • 2021-10-25
  • 2021-10-15
  • 2021-10-26
  • 2022-12-23
  • 2021-10-16
  • 2021-10-15
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2021-10-15
  • 2021-08-24
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案