R
Railway•6mo 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•6mo ago
Project ID: 4c2cf819-c7e8-4ee0-89d8-13086fc777fb
Hys
HysOP•6mo 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•6mo 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
HysOP•6mo ago
🙂
Brody
Brody•6mo ago
glad you figured it out, was about to say that the html page returned would not be returned by railway
Want results from more Discord servers?
Add your server