Logo
DevUtilsAll-in-one toolkit
Back to all codes
4134xx
4xx — Client Error

Content Too Large

Request entity is larger than limits defined by server.

What it means

The HTTP 413 Content Too Large response status code indicates that the request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field.

(Previously known as Payload Too Large).

How it works

  • 1The client attempts to upload a 50MB video.
  • 2The server is configured with a 10MB maximum upload limit.
  • 3The server immediately rejects the request with a 413.

Why you're seeing this

  • The uploaded file is too large.
  • A JSON payload is excessively massive.

How to fix it

  • Compress the file on the client side before uploading, or chunk the upload into smaller pieces if the server supports it.

Framework Implementations

Nginx

server {
  client_max_body_size 10M; # Nginx automatically returns 413 if exceeded
}

Real-Life Scenarios

Use this whenever a client exceeds your API's upload size limits to protect against Denial of Service (DoS) memory exhaustion attacks.

Avatar Uploads

A website allows users to upload a profile picture up to 2MB. A user tries to upload a 15MB RAW photo. The server responds with 413.

HTTP Transaction

1. Client Request

POST /avatar HTTP/1.1
Content-Length: 15000000

(massive binary data...)

2. Server Response

HTTP/1.1 413 Content Too Large
Connection: close
Content-Type: application/json

{"error": "File exceeds the 2MB limit."}

SEO Implications

None.

Related Codes