Urlencoded Body Parser
Small parser for http.IncomingMessage that turns application/x-www-form-urlencoded
data into a javascript object using qs.
Api
parse(req, {limit = '1mb'} = {})
- Use
require('urlencoded-body-parser')
- Returns a
Promise
- Buffers and parses the incoming body and returns it.
limit
is how much data is aggregated before parsing at max. It can be aNumber
of bytes or a string like'1mb'
.- The Promise is rejected when an error occurs
Usage
Using Micro:
const parse = module { const data = await console return ''}
Using build in HTTP server:
const http = ;const parse = const server = http; server;