I faced the same issue recently and bellow solution workes for me.
Dependency : express >> version : 4.17.1body-parser >> version": 1.19.0
const express = require('express');const bodyParser = require('body-parser');const app = express(); app.use(bodyParser.json({limit: '50mb'}));app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
For understanding :HTTP 431
The HTTP 413 Payload Too Large response status code indicates that therequest entity is larger than limits defined by server; the servermight close the connection or return a Retry-After header field.