【问题标题】:there is any body-parser for the http module Node.jshttp模块Node.js有任何body-parser
【发布时间】:2015-01-29 01:24:39
【问题描述】:

我正在 Node.js 中启动一个新项目,包括 http 模块,但我无法访问 POST 请求的正文。 有没有可以解析请求正文的中间件? 我已经尝试过 body-parser 模块,但它不适用于 http 模块。 并且 只想将 express 用于 bodyparser 中间件。 有人有解决办法吗?

【问题讨论】:

  • 定义“不工作”。
  • 例如 busboymulter 在后台使用。
  • http模块没有express这样的使用方法
  • @RoiTal 只是知道如何在没有中间件框架的情况下调用中间件(.use())?
  • @RoiTal 另外,“我已经尝试过 body-parser 模块”是什么样的?你能分享一下你的代码的sn-p吗?

标签: node.js


【解决方案1】:

您可以使用body,对于多部分实体node-formidable

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-17
    • 1970-01-01
    • 2023-03-08
    • 1970-01-01
    • 2021-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多