413 Content Too Large

The request body is larger than the server is willing or able to process.

Status

HTTP/1.1 413 Content Too Large

Details

413 (previously called Payload Too Large, and before that Request Entity Too Large) means the body exceeded a configured limit. The limit is frequently enforced by infrastructure rather than the application: nginx client_max_body_size, an ingress controller default, or a serverless platform's payload cap.

If the condition is temporary, the server may include Retry-After. Usually it is not temporary, and the fix is either a smaller upload or a raised limit.

Note: Body limits are usually enforced by infrastructure rather than the application. Raising the app limit changes nothing while nginx, an ingress controller, or a platform cap still rejects the request.

Headers

Common causes

How to fix it

As the client

As the server

Examples

Uploading a file over the size limit

An upload larger than the configured limit:

HTTP request

POST /api/uploads HTTP/1.1
Host: api.example.com
Content-Length: 26214400

The request is rejected before the body is processed, and the response states the maximum:

HTTP response

HTTP/1.1 413 Content Too Large
Content-Type: application/json; charset=utf-8

{"error":"payload_too_large","max_bytes":10485760}

Specifications

See also