Payload too large 413
hysmx
FREEOP

2 years ago

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?

5 Replies

hysmx
FREEOP

2 years ago

4c2cf819-c7e8-4ee0-89d8-13086fc777fb


hysmx
FREEOP

2 years ago

tried reducing from 22,000 records to just 1000 but it still says payload too large


hysmx
FREEOP

2 years ago

Fixed it by using

const bodyParser = require('body-parser');

app.use(bodyParser.json({ limit: '50mb' }));
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true }));

hysmx
FREEOP

2 years ago

🙂


brody
EMPLOYEE

2 years ago

glad you figured it out, was about to say that the html page returned would not be returned by railway


Loading...