In case you have some special routes where you want to access raw request body and they are declared before the global bodyParser middlewares. You want to explicitly set the raw limit. This could be done as follows:
import express from 'express';/* Rest of the code */// Assuming you want your JSON payload raw and it gets larger than the default 100kbapp.post('/test', express.raw({ type: 'application/json', limit: '10mb' }), async (req, res) => { // use `req.body` raw value i.e. verify content hash // parse the body and use it as necessary const parsed = JSON.parse(req.body.toString()); res.sendStatus(200); },);This snippet should work for express 4.18.2.