Hacker News new | ask | show | jobs
by mzzter 1739 days ago
Any links to APIs that implement a 418 HTTP response code?
9 comments

If I have anything to do with it, there is a 418 response hidden somewhere.

I recall a few internal projects at a previous employer would return 418 if the user managed to royally mess something up as a "wtf, how are you here?!" kind of response.

I feel like I am not alone in implementing 'weird' HTTP codes when I get bored / as an easter egg. Pretty sure I also used HTTP 420 at least once.

Unlike 418 I'm a Teapot, 420 Enhance Your Calm is actually a nonstandard HTTP status code. The correct response is 429 Too Many Requests. [1]

[1]: https://datatracker.ietf.org/doc/html/rfc6585#section-4

Ah, the good ol' 420 - EnhanceYourCalm
“Uhh ummm no” -code reviewer
Yeah, code reviews definitely killed some of the fun in coding, they are rarely performed with humor.
I generally make it a goal to have a test case with silly enough data to get a comment from a reviewer.
I remember reviewing a really long document (> 50 pages) that had in one bullet list the phrase 'Marks and Spencer tandoori chicken sandwich'. The doc was otherwise camera ready and the phrase was obviously there to see if I was in fact reading it
I added the 418 response code to my gopher server [1]. There was one web bot that constantly hit it and was clueless that it wasn't a web server. It finally got a clue.

[1] https://github.com/spc476/port70

Binance API (i.e https://api.binance.com/api/v3/ticker/price) does it when there are too many requests from one IP (I assume that's the reason). They could have used something else like 429 but for some obscur reasons they're using 418 (if anyone knows the actual reason...).

It will happen often if you try to make a call to their API through Google sheet scripts.

Http.cat implements it: https://http.cat/418
I sometimes return a 418 when request heuristics detect bad behavior that looks intentional. I don’t document it, though.
No link but our internal API for mobile apps returns a 418 if the installed version is too old.
If you have an IoT teapot, when do you return it?
From the docs:

> ... indicates that the server refuses to brew coffee because it is, permanently, a teapot.

So I guess, when it is asked to perform coffee brewing? But pay close attention, to your general purpose brewer:

> A combined coffee/tea pot that is temporarily out of coffee should instead return 503.