HTTP 431 Request Header Fields Too Large vs 511 Network Authentication Required
HTTP 431 (Request Header Fields Too Large) is a 4xx Client Error response, while 511 (Network Authentication Required) is a 5xx Server Error response. 431 indicates that the server refuses to process the request because an individual header field or all headers collectively are too large. In contrast, 511 means that the client needs to authenticate to gain network access. Used by captive portals (hotel/airport WiFi).
Description
The server refuses to process the request because an individual header field or all headers collectively are too large.
When You See It
When cookies accumulate to an excessive size, or a single header (like Authorization) is too long.
How to Fix
Reduce header sizes. Clear excessive cookies. Use shorter tokens.
Description
The client needs to authenticate to gain network access. Used by captive portals (hotel/airport WiFi).
When You See It
When connecting to WiFi that requires login (airport, hotel, coffee shop).
How to Fix
Open a browser and complete the captive portal login process.
Key Differences
431 is a 4xx Client Error response, while 511 is a 5xx Server Error response.
HTTP 431: The server refuses to process the request because an individual header field or all headers collectively are too large.
HTTP 511: The client needs to authenticate to gain network access. Used by captive portals (hotel/airport WiFi).
You encounter 431 when when cookies accumulate to an excessive size, or a single header (like Authorization) is too long.
You encounter 511 when when connecting to WiFi that requires login (airport, hotel, coffee shop).
When to Use Which
For 431 (Request Header Fields Too Large): Reduce header sizes. Clear excessive cookies. Use shorter tokens. For 511 (Network Authentication Required): Open a browser and complete the captive portal login process.