Node.js body parsing middleware. Parse incoming request bodies in a middleware before your handlers, available under the req.body property. As req.body's shape is based on user-controlled input, all properties and values in this object are untrusted and should be validated before trusting. For example, req.body.foo.toString() may fail in multiple ways, for example the foo property may not be there or may not be a string, and toString may not be a function and instead a string or other user input. The bodyParser object exposes various factories to create middlewares. All middlewares will populate the req.body property with the parsed body when the Content-Type request header matches the type option, or an empty object ({}) if there was no body to parse, the Content-Type was not matched, or an error occurred.

Features

  • Control the maximum request body size
  • Add a generic JSON and URL-encoded parser as a top-level middleware
  • Add body parsers specifically to the routes that need them
  • Parse the bodies of all incoming requests
  • All the parsers accept a type option which allows you to change the Content-Type that the middleware will parse
  • Change accepted type for parsers

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow body-parser

body-parser Web Site

You Might Also Like
無料プランが拡大! | Auth0
無料プランが拡大! | Auth0 Icon
無料プランが拡大! | Auth0

無料プランのMAUは25,000まで、さらに、Okta Connectionsが無制限になり、開発者のみなさんがアプリの開発に注力することができるようになりました。

無料・有料プランを拡張してほしい!そのような声を開発者の方々からいただき、プランが大幅に変更されました。プランの制約とセキュリティーの悩みから解き放たれ、みなさんが開発に集中できるようになることを願っています。
無料で始める
You Might Also Like
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of body-parser!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Parser Generators

Registered

2021-11-01