HTTP 431 Request Header Fields Too Large

The server refuses the request because the header fields are too large.

4xx Client Error

431

Request Header Fields Too Large

Description

The 431 Request Header Fields Too Large status code indicates that the server is unwilling to process the request because its header fields are too large. The request may be resubmitted after reducing the size of the request header fields. It can be used both when the set of request header fields in total is too large, and when a single header field is too large. In the latter case, the response representation should specify which header field was too large. This often occurs when cookies accumulate to an excessive size, or when authorization tokens become very long.

When Is It Used?

Returned when request headers exceed the server's configured maximum size. Common causes include oversized cookies, very long JWT tokens in the Authorization header, or an excessive number of custom headers.

Example Response

HTTP/1.1 431 Request Header Fields Too Large
Content-Type: application/json

{"error": "header_too_large", "message": "The Cookie header exceeds the maximum allowed size"}

Look Up Any Status Code

Browse all status codes