HTTP 412 Precondition Failed vs 511 Network Authentication Required
HTTP 412 (Precondition Failed) is a 4xx Client Error response, while 511 (Network Authentication Required) is a 5xx Server Error response. 412 indicates that one or more conditions in the request headers (If-Match, If-Unmodified-Since) evaluated to false. In contrast, 511 means that the client needs to authenticate to gain network access. Used by captive portals (hotel/airport WiFi).
Description
One or more conditions in the request headers (If-Match, If-Unmodified-Since) evaluated to false.
When You See It
When using conditional requests with ETags and the resource has changed.
How to Fix
Refresh the ETag/Last-Modified value and retry with updated preconditions.
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
412 is a 4xx Client Error response, while 511 is a 5xx Server Error response.
HTTP 412: One or more conditions in the request headers (If-Match, If-Unmodified-Since) evaluated to false.
HTTP 511: The client needs to authenticate to gain network access. Used by captive portals (hotel/airport WiFi).
You encounter 412 when when using conditional requests with ETags and the resource has changed.
You encounter 511 when when connecting to WiFi that requires login (airport, hotel, coffee shop).
When to Use Which
For 412 (Precondition Failed): Refresh the ETag/Last-Modified value and retry with updated preconditions. For 511 (Network Authentication Required): Open a browser and complete the captive portal login process.