'Are there languages/software that implements http status code 418? [closed]
I know that status code 418 was defined as a April Fools' joke, and "is not expected to be implemented by actual HTTP servers" as is stated on Wikipedia.
But I would be interested if any of you knew of a language/webserver/IDE that supports it.
I was trying on Apache (via php), and obviously it got me an internal error (500). I just like the humor behind it (am not trying to troll here) and would like to know if more than just Emacs implements this.
More precisely: It could be emulated in php for example by doing something like ...
header("HTTP/1.1 418 Whatever text I'd like");
... but do any of you know any actual server software, or language in particular, that implements it natively, where something like the following would not throw a 500, but actually work:
http_response_code(418);
Solution 1:[1]
Solution 2:[2]
Yes, it is implemented (by a teapot).
This error code is an impotent part of HTCPCP(Hyper Text Coffee Pot Control Protocol).
Solution 3:[3]
Python 3.9 will support HTTP 418 from its next (fifth) alpha release. I opened a pull request for this to be supported which was merged last weekend.
Solution 4:[4]
Stack overflow implements it:
albeit, a little creative, when dealing with CSRF violations.
Solution 5:[5]
Go lang's net/http package codifies HTTP 418 Status as a constant: StatusTeapot.
Solution 6:[6]
My server, www.snarked.org, does it if the pathname begins "/coffee" or "/pot-" followed by a digit, or methods BREW or WHEN, or a scheme equating to "coffee:" (actually, the regex pattern "^[CK][AO]FF?[EIO]E?$" which covers most western-European languages). After 60 seconds, it rolls over to Google's top hit for teapots.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Buttle Butkus |
| Solution 2 | Community |
| Solution 3 | Ross |
| Solution 4 | Community |
| Solution 5 | Mike Atlas |
| Solution 6 | MR. X |
