What does HTTP status code 431 mean?
The 431 Request Header Fields Too Large status code indicates that the server rejects the request because the headers (or a single header field) are too large.
When to use it in APIs
Usually triggered when a client sends extremely large cookies, authorization tokens (like bloated JWTs), or request parameters.
How it compares to other codes
- 400 Bad Request: A generic request failure. 431 explicitly points to header size violations.