Reputation: 31
We have this request error where we were not able to send the request in express server even though we set parameterLimit and bodyParser.
we have tried setting parameterLimit:50000000000000, but still the same issue
app.use(bodyParser.json({limit: '15360mb', type: 'application/json'}))
app.use(bodyParser.urlencoded({limit: '15360mb', extended: true, type: 'application/json', parameterLimit: 5000000}))
We use
Node:8.9.4
body-parser: '1.18.3'
express: '4.17.0'
Upvotes: 0
Views: 2511
Reputation: 6718
From docs:
request entity too large
This error will occur when the request body's size is larger than the
"limit"
option. The limit property will be set to the byte limit and the length property will be set to the request body's length. The status property is set to 413 and the type property is set to 'entity.too.large'.limit
Controls the maximum request body size. If this is a number, then the value specifies the number of bytes; if it is a string, the value is passed to the bytes library for parsing. Defaults to '100kb'
So you've to increase the limit
option. For example, for json
, setting limit
to 10 MB
bodyParser.json({ limit: '10mb' })
Upvotes: 1