Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

body-parser-multidict

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

body-parser-multidict

Fork of body-parser with Werkzeug's MultiDict support for urlencoded forms

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

body-parser-multidict

Build Status

Fork of body-parser with Werkzeug's MultiDict support for urlencoded forms

We built querystring-multidict for consistent typing when reading query strings (e.g. .get() always returns a single string value whereas querystring/qs can return an array/object depending on user input). Additionally, we added .fetch() to make throwing form validation errors easier.

Getting Started

This module can be installed via: npm install body-parser-multidict

Its usage is the same as body-parser:

// Load in our dependencies
var express = require('express');
var bodyParserMultiDict = require('body-parser-multidict');

// Create a new app using our urlencoded parser
var app = express();
app.use(bodyParser.urlencoded());

// Handle requests
app.use(function (req, res) {
  // Example request: `POST foo=bar&foo=baz`
  // First received value under key
  req.body.get('foo'); // 'bar'
  // Array of values received under key
  req.body.getArray('foo');// ['bar', 'baz']
});

Documentation

Documentation is the same as body-parser except req.body is a MultiDict. See querystring-multidict for MultiDict documentation:

https://github.com/twolfson/querystring-multidict/tree/1.1.0#multidict

License

MIT

FAQs

Package last updated on 05 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc