HTTP/4xx (Client Error)
413 Payload Too Large
The request entity is larger than limits defined by server configuration.
❓ Why does this happen?
Uploading a file larger than client_max_body_size (Nginx) or serverless body limits (e.g. 4.5MB on Vercel).
✅ How to fix it
Compress payload or use direct presigned S3/storage uploads instead of proxying through the app server.
Return or handle 413 in your stack
// app/api/resource/route.ts
export function GET() {
return Response.json(
{ error: "Payload Too Large", status: 413 },
{
status: 413
}
);
}Live 413 mock endpoint
Point your app, tests, or retry logic at this free public URL to reproduce a real 413 response (CORS enabled, optional ?delay=ms up to 5000).
https://castov.com/api/mock/413Frequently Asked Questions
What does HTTP Status 413 mean?
Why am I getting a 413 status code?
How do I fix a 413 Payload Too Large error?
How can I test how my app handles a 413 response?
Other 4xx status codes
Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.