R
Railway•2mo ago
Hys

Payload too large 413

Trying to post to my API hosted on railway about 20,000 records into my API at once, its saying it cant due of the payload being too large, what's the limit and how can i change it?
No description
Solution:
Fixed it by using ```js const bodyParser = require('body-parser'); app.use(bodyParser.json({ limit: '50mb' }));...
Jump to solution
5 Replies
Percy
Percy•2mo ago
Project ID: 4c2cf819-c7e8-4ee0-89d8-13086fc777fb
Hys
Hys•2mo ago
4c2cf819-c7e8-4ee0-89d8-13086fc777fb tried reducing from 22,000 records to just 1000 but it still says payload too large
Solution
Hys
Hys•2mo ago
Fixed it by using
const bodyParser = require('body-parser');

app.use(bodyParser.json({ limit: '50mb' }));
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));
const bodyParser = require('body-parser');

app.use(bodyParser.json({ limit: '50mb' }));
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));
Hys
Hys•2mo ago
🙂
Brody
Brody•2mo ago
glad you figured it out, was about to say that the html page returned would not be returned by railway