Socket
Socket
Sign inDemoInstall

@body/urlencoded

Package Overview
Dependencies
14
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @body/urlencoded

Parse an URL-encoded body of an incoming HTTP request.


Version published
Weekly downloads
171
increased by74.49%
Maintainers
1
Install size
137 kB
Created
Weekly downloads
 

Readme

Source

URL-encoded body parser

Parse an URL-encoded body of an incoming HTTP request.

Installation

npm install --save @body/urlencoded

Usage

const getUrlencodedBody = require('@body/urlencoded')

// ...

app.post('/v1/users', async (req, res, next) => {
  try {
    const body = await getUrlencodedBody(req)

    // ...
  } catch (err) {
    return next(err)
  }
})

// ...

API

getUrlencodedBody(req: Request, options: Options): Promise<any>

Parse the body of the incoming request req. Returns a promise of the parsed body.

Options
inflate (boolean)

When set to true, then bodies with a deflate or gzip content-encoding will be inflated before being parsed.

Defaults to false.

FAQs

Last updated on 13 Nov 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc