8 ms·
Any links to APIs that implement a 418 HTTP response code?
by mzzter 5y ago
Any links to APIs that implement a 418 HTTP response code?
- lodovic 5y ago.Net seems to have it: https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.statuscodes.status418imateapot?view=aspnetcore-5.0 https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnet...
- jamespwilliams 5y agohttp.StatusTeapot in Go: https://pkg.go.dev/net/http#pkg-constants https://pkg.go.dev/net/http#pkg-constants 4k+ results on Github: https://github.com/search?utf8=&q=http.StatusTeapot&type=Code; https://github.com/search?utf8=&q=http.StatusTeapot&type=Cod... ~600 excluding _test.go files: https://github.com/search?q=http.StatusTeapot+-filename%3A*_test.go&type=Code https://github.com/search?q=http.StatusTeapot+-filename%3A*_...
- deleted 5y ago[deleted]
- madamelic 5y agoIf 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.
- flatiron 5y ago“Uhh ummm no” -code reviewer
- codr7 5y agoYeah, code reviews definitely killed some of the fun in coding, they are rarely performed with humor.
- rockwotj 5y agoI generally make it a goal to have a test case with silly enough data to get a comment from a reviewer.
- KineticLensman 5y agoI 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
- deleted 5y ago[deleted]
- jylauril 5y agoAh, the good ol' 420 - EnhanceYourCalm
- deleted 5y ago[deleted]
- divbzero 5y agoUnlike 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 https://datatracker.ietf.org/doc/html/rfc6585#section-4
- tbronchain 5y agoBinance API (i.e https://api.binance.com/api/v3/ticker/price 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.
- darkhorn 5y agohttps://www.google.com/teapot https://www.google.com/teapot
- pkd 5y agoNo link but our internal API for mobile apps returns a 418 if the installed version is too old.
- lallysingh 5y agoIf you have an IoT teapot, when do you return it?
- TobTobXX 5y agoFrom 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.
- spc476 5y agoI 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 https://github.com/spc476/port70
- claviska 5y agoI sometimes return a 418 when request heuristics detect bad behavior that looks intentional. I don’t document it, though.
- atoav 5y agoHttp.cat implements it: https://http.cat/418 https://http.cat/418