Error 413 (Payload Too Large) custom context variables
huesoamz opened this issue · 4 comments
We have a custom solution that send customs context variables to watson that we define on our custom backend, the problem its that the
This is the error:
PayloadTooLargeError: request entity too large<br> at readStream (/node_modules/body-parser/node_modules/raw-body/index.js:155:17)<br> at getRawBody (/node_modules/body-parser/node_modules/raw-body/index.js:108:12)<br> at read (/node_modules/body-parser/lib/read.js:77:3)<br> at jsonParser (/node_modules/body-parser/lib/types/json.js:134:5)<br> at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)<br> at trim_prefix (/node_modules/express/lib/router/index.js:317:13)<br> at /node_modules/express/lib/router/index.js:284:7<br> at Function.process_params (/node_modules/express/lib/router/index.js:335:12)<br> at next (/node_modules/express/lib/router/index.js:275:10)<br> at serveStatic (/node_modules/express/node_modules/serve-static/index.js:75:16)</pre>
What could be the correct solution? increse the limit on the body parser, like this?:
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
We are using the app.js
by default without setting any limit
@stevenpkg Can you advise.
I do not have an answer for you, you will need to debug your own code, as this space is only for issues with demo code
@huesoamz you need to increase the payload as you suggested above. I think the demo uses the default value which is 1mb.
I'm closing this since it's not a problem with this demo