ENCODINGS
Documentation for Redweb 0.13.0. Install that exact version when following these examples.
Supported request-body parser names for HTTP server configuration.
Explain it like I’m five
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 API pattern illustrates the named surface; it may require application-owned classes, credentials, or assets. Start from a complete recipe for a runnable application.
const { ENCODINGS } = require('redweb')
// ENCODINGS.json, ENCODINGS.urlencoded- The selected constant is passed in HttpServer options.
- Redweb installs the corresponding Express body parser.
- 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.
What should I watch for?
Body parsing is not schema validation. Limit body size and validate every field before using it.