418“我是茶壶”真的是HTTP响应代码吗?

在互联网上有各种各样的参考,包括在响应代码列表中,但我不知道这是否是一个奇怪的笑话。


当前回答

你真的不应该用超文本茶壶控制协议(HTTCP)来煮咖啡。这是HTCPCP(超文本咖啡壶控制协议)的工作。

其他回答

HTTP响应代码418最初是在RFC 2324(“超文本咖啡壶控制协议(HTCPCP/1.0)”)和RFC 7168(“茶叶外排设备超文本咖啡壶控制协议(HTCPCP- Tea)”)协议中定义的。

根据维基百科:HTTP状态代码列表:#418

这段代码在1998年被定义为传统的IETF愚人节玩笑之一,在RFC 2324(超文本咖啡壶控制协议)中,预计不会被实际的HTTP服务器实现。RFC指定该代码应由用于冲泡咖啡的茶壶返回。这个HTTP状态在一些网站(包括Google.com)中被用作彩蛋。

是的,我可以确认,我已经看到HTTP 418从真正的生产服务器返回。它确实存在。

你真的不应该用超文本茶壶控制协议(HTTCP)来煮咖啡。这是HTCPCP(超文本咖啡壶控制协议)的工作。

Yes it's a "real" code in the sense that it was published as part of an official RFC by the Internet Engineering Task Force, RFC-2324. However, since that RFC was published on April 1 and meant as an April fools joke (along with the rest of Hyper Text Coffee Pot Control Protocol), not for legitimate implementation, it's not a "serious" code in the typical sense*. That's why most sites use it as an Easter egg, but otherwise avoid it. As noted by wizulus in this comment, there are often more appropriate statuses like 400 (Bad Request). Despite its satirical nature, it's now a reserved code (presumably as a result of becoming a popular engineering meme for the briefest moment), so don't expect it to be going anywhere anytime soon.

*根据RFC的作者Larry M Masinter的说法,问题中的HTTP扩展实际上有一个严肃但讽刺的目的:“它确定了HTTP扩展不恰当的许多方式。”

我认为把418当作一个曾经有半官方含义,但现在正式“未分配”的保留代码是更安全的。

我认为,历史上对这些代码的看法与现在有所不同。这在今天听起来毫无意义,也很有趣;也许不是?

换句话说,我将避免使用此代码。