HTTP

HTTP 412 Precondition Failed vs 418 I'm a Teapot

Both HTTP 412 (Precondition Failed) and 418 (I'm a Teapot) belong to the 4xx Client Error category. 412 indicates that one or more conditions in the request headers (If-Match, If-Unmodified-Since) evaluated to false. Meanwhile, 418 means that any attempt to brew coffee with a teapot should result in this error. An April Fools' joke from 1998 that became a beloved part of HTTP culture.

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

Any attempt to brew coffee with a teapot should result in this error. An April Fools' joke from 1998 that became a beloved part of HTTP culture.

When You See It

As an Easter egg on some websites, or when a server humorously refuses a request.

How to Fix

Use a coffee pot instead of a teapot. Or just enjoy the joke.

Key Differences

1.

HTTP 412: One or more conditions in the request headers (If-Match, If-Unmodified-Since) evaluated to false.

2.

HTTP 418: Any attempt to brew coffee with a teapot should result in this error. An April Fools' joke from 1998 that became a beloved part of HTTP culture.

3.

You encounter 412 when when using conditional requests with ETags and the resource has changed.

4.

You encounter 418 when as an Easter egg on some websites, or when a server humorously refuses a request.

When to Use Which

For 412 (Precondition Failed): Refresh the ETag/Last-Modified value and retry with updated preconditions. For 418 (I'm a Teapot): Use a coffee pot instead of a teapot. Or just enjoy the joke.

Learn More