ENCODINGS
Supported request-body parser names for HTTP server configuration.
Explain it like I’m five
The simple mental model
ENCODINGS is a tiny menu that lets you choose whether request bodies arrive as JSON or traditional URL-encoded form data.
When should I use it?
Use the constants when configuring HTTP body parsing so spelling stays aligned with supported Redweb values.
Follow the example
This pattern explains the named API. Application classes, credentials, and assets may need to be supplied; use a complete recipe for a runnable starting point.
const { ENCODINGS } = require('redweb')
// ENCODINGS.json, ENCODINGS.urlencoded- 1
The selected constant is passed in HttpServer options.
- 2
Redweb installs the corresponding Express body parser.
- 3
Route handlers then read the parsed value from req.body.
Methods and members
json
Use Express JSON body parsing.
urlencoded
Use Express URL-encoded body parsing.