Skip to content

Body too large

FieldValue
Type URIhttps://echo.labstack.com/pro/problems/body-too-large
Codebody_too_large
HTTP status413
HTTP statusEnglish title
413Request Entity Too Large

The request body is larger than the server accepts. Either the Content-Length header or the bytes actually read exceeded the limit.

Send a smaller body.

If your application installs a custom handler, the body may differ.

HTTP/1.1 413 Request Entity Too Large
Content-Type: application/problem+json
{
"code": "body_too_large",
"status": 413,
"title": "Request Entity Too Large",
"type": "https://echo.labstack.com/pro/problems/body-too-large"
}

If the API must accept larger bodies, raise MaxBodyBytes before deployment. After the response starts, the server cannot replace it with a 413.

  • type (string, always): The exact type URI above.
  • title (string, always): The HTTP status text.
  • status (integer, always): The HTTP status of the response.
  • detail (string, optional): Explanation text. Left out when empty.
  • code (string, always): The stable code above.

Notes:

  • The limit is MaxBodyBytes (default 1 MiB). The default OpenAPI ProblemHandler writes RFC 9457 JSON with type, title, status and code.
  • The chain does not read the body before authentication. If auth finds the overflow, quota charges nothing. If quota already checked the request, the charge stays, subject to its settlement policy. A handler that reads only part of the body may not detect overflow.
  • Once the response starts, the chain passes a *BodyTooLargeError to OnError. It cannot replace the response with 413.
  • type (string, always): The exact type URI above.
  • title (string, always): The catalog title in the rendered language: English by default, Japanese only when the application selects it.
  • status (integer, always): The HTTP status of the response.
  • code (string, always): The stable code above.
  • detail (string, optional): Display text that your application sets, up to 256 bytes with problem.NewError. Omitted when you set none.

Headers:

  • Cache-Control (conditional): no-store, set by problem/echoadapter.
  • Content-Language (conditional): en or ja, set by problem/echoadapter from its configured language.

Notes:

  • The adapter keeps existing WWW-Authenticate, Allow and Retry-After headers and adds no challenge or retry advice of its own.
  • On HEAD, the adapter’s Content-Length equals the GET body’s length.
  • Return this code only when your body limiter rejected the request. Other 413 responses are not this problem.

See the problem catalog for application error handling.