1

I know that 413 HTTP code is when the request size is too large.

I'm trying to figure out the best HTTP code to respond with if the request was accepted but the server cannot respond as the response body is too large.

From the RFC

The 413 (Payload Too Large) status code indicates that the server is refusing to process a request because the request payload is larger than the server is willing or able to process. The server MAY close the connection to prevent the client from continuing the request.

If the condition is temporary, the server SHOULD generate a
Retry-After header field to indicate that it is temporary and after
what time the client MAY try again.

It seems 413 could only be used for request size, and not response size.

astroanu
  • 3,901
  • 2
  • 36
  • 50

0 Answers0