Would the HTTP 418 "I’m a Teapot" response be valid?

Asked

Viewed 2,440 times

10

A certain API is returning me a status 418 I'm a teapot, I saw that it is part of the protocol HTCPCP.

             ;,'
     _o_    ;:;'
 ,-.'---`.__ ;
((j`=====',-'
 `-\     /
    `-=-'     
  • The use of this status can be considered as a valid return?
  • 2

    I don’t think that its implementation should be done on a production server, because it was born from a joke of April 1st, but there is even RFC: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418

  • 6

    @Danielmendes if I make an HTCPCP request for a kettle in production environment which I should use then?

  • it would not be valid to use this code when someone tries to do something that the server does not?

3 answers

14


This status 418 today is reserved to "I’m a Teapot", but I’ll tell you a little bit about this process.

As already said this status is a joke, appeared on 04/01/1998, ie a joke "first of April", even Google used it:

However what remains to be said is that this status has been proposed to be removed, Mark Nottingham, IETF president (at the time, today I don’t know) requested the removal of this status from some languages and libraries in response to this, Shane Brunswick (a developer, for some reason stressed that at the time he was only 15 years old) created a website called https://save418.com/ ("Save 418 Movement"), in the proposal he cited some arguments in favor of maintaining the 418 status, but I believe that the one that most convinced people was this argument:

... It’s a Reminder that the underlying processes of Computers are still made by Humans.

Translated:

... It’s a reminder that the underlying processes of computers are still done by humans.

This has gone viral (at least among the public that is in the development area and participants of the Reddit) that caused the hashtag #save418 on social media.

With this the HTTP languages and libraries that intended to remove the status 418 have decided to keep it, not because it is useful or because it is applicable, it was only by the facts occurred before.

These events led Mark Nottingham to file a lawsuit to make the 418 a reserved status so that it is not replaced in the future by another use, which is basically for all these reasons that the status still exists.


Answering the question:

The use of this status can be considered as a valid return?

Validity is a matter of context, without any context and speaking only of HTTP can say yes, it is valid, but use for use has no sense, as well as use any other code without context.

Reinforcement saying that even being today a reserved code this does not mean that it will be useful to you, unless you want to play too (and find it prudent at the moment), for example, on the first of April in any specific HTTP error(s) (example 404) you would exchange for 418 (as long as it does not affect anyone using the service).

Long story short, has no real use, has a support of communities and people for historical motivations and some "appreciation" to remember that things are created by humans yet.

You don’t have to worry about solving this status, but also if you notice it on a request from another server that does, you know, it’s probably a prank and probably has a way around it or you’ve definitely fallen into the wrong place or done something wrong, to fall into such a joke.

9

The HTTP 418 code is part of a specification (RFC), which was published as a joke on April 1st (source).

According to the specification, this code is valid if you have asked a coffee maker to make coffee, but the "server" is not a coffee maker but a "tea pot" (kettle?).

While not a serious specification, several libraries and frameworks have implemented this specification as a way to continue the joke.

As the specification was never recognized by the IETF (the body responsible for endorsing HTTP-related specifications) it is theoretically not valid for a real server. But even so, nothing prevents some services from implementing this code.

0

By definition, all status codes starting with 4 are "Client Error" status code. Therefore, you need to consider this as a failure. Success status is those that start with 2.

418 I'm a teapot is a status code made as April 1 and should not be used in production.

You’ll need to talk to whoever made the endpoint to understand what he meant by that.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.