HTTP 413 Content Too Large

The request body exceeds what the server will accept. Still widely known by its old reason phrase, Payload Too Large.

Defined in RFC 9110 §15.5.14 — 413 Content Too Large · MDN reference

RFC 7231 called this "Payload Too Large"; RFC 9110 renamed it. Both refer to the same code.

Where you meet HTTP 413 in production

File uploads past a limit, oversized JSON payloads, batch requests with too many items — often enforced by a proxy before the application ever sees the request.

Why you would test it

Test at the boundary, not far past it. A client that streams uploads may fail differently from one that buffers.

What your client should do about a 413

Do not retry the same payload. Compress it, chunk it, or reject it client-side with a clear message. Check the limit before uploading where the API publishes one; failing at the browser is far cheaper than failing after a 40 MB upload.

413 versus the codes it gets confused with

Endpoints that return 413

1 endpoint in this playground answers with 413. Every one is free, needs no signup, and can be called from the browser or with curl.

Questions about HTTP 413

Who enforces the limit?
Often a reverse proxy or gateway, which is why a 413 can arrive without any application log line to match it.
Can the server say what the limit is?
It should, in the body — and a Retry-After is appropriate if the limit is temporary.

Other client error codes

All HTTP status codes · All 39 mock REST APIs · Getting started guide

Last updated