POST http://localhost:3000/api/rawSensorData 413 (Request Entity Too Large)
requesting post with long text data gives me '413 Request Entity Too Large' after little digging, I found some answers from stackoverflow about express body parser.
I've tried below code in server.js but I have no luck.
app.use(loopback.bodyParser.json({limit: '1024mb'})); app.use(loopback.bodyParser.urlencoded({limit: '1024mb', extended: true}));
how to solve this issue?
And I can now this error in chrome dev console.
GET http://api.mydomain.com/v1/plans 404 (Not Found) How to fix it?
thank you @sjmcdowall !
Once the size limit is dealt with, some apps may need to also set the parameterLimit to a larger size to avoid a "too many parameters" error. For example,
"body-parser#json": { "params" : { "limit" : "50mb", "parameterLimit": 1000000} },
"body-parser#urlencoded": {"params": { "limit" : "50mb", "extended": true, "parameterLimit": 1000000 }}
Or like this in server.js...
If you are hosting the server on NGINX try the following
Modify NGINX Configuration File
sudo nano /etc/nginx/nginx.conf Search for this variable: client_max_body_size. If you find it, just increase its size to 100M, for example. If it doesn’t exist, then you can add it inside and at the end of http
client_max_body_size 100M; Restart nginx to apply the changes.
sudo service nginx restart