Axios POST request 413 (Payload Too Large) Axios POST request 413 (Payload Too Large) reactjs reactjs

Axios POST request 413 (Payload Too Large)


The solution to this problem lies within body parser and how your middleware is set up. Body-parser's limit option will only take in effect if your content-type and type option match. It looks like you're sending regular json to the server, your bodyparser middleware should look something like this.

var express = require("express");var bodyParser = require("body-parser");var app = express();app.use(bodyParser.json({limit: '100kb'}));

If the payload is still too large, increment the bodyParser.json() limit option. Try '200kb', try '300kb'. 100kb shoudld be enough though.

If this bodyParser middleware does not work, please show your body-parser middleware.