📜 ⬆️ ⬇️

HTTP Codes in Valentine's Day Comics

Valentine's Day is already tomorrow. For some, this is a time of romantic hopes, time to ask the "lady of the heart" and get an answer. It could be just “yes”, sad “no” or mysterious “I didn’t think of us as a couple, but maybe tomorrow we can have dinner together?”

This, although indirectly, leads us to HTTP (Hypertext Transfer Protocol) status codes. When the URL is entered in the browser, the request is sent to the server. As in our script, the browser is awaiting a response. These responses come in the form of an HTTP code, which is a three-digit number that is matched with a specific meaning.

Here are some likely scenarios for Valentine's Day comics.
')

200s: Success


Class 200 codes usually mean that everything is in order. The request was received, understood, and there were no errors on the server. For example, this URL will return 200 OK - successful request.

Ideal completion for pairs “browser + server” and “developer + its project”

300s: Redirection


Class 300 codes mean that the client must take further action to complete the request. The 300s also have all redirects.

The person will probably never see the 300th codes, because the browser without the user must take the necessary actions. However, search engines are serious about these 300th codes, so developers should take care of choosing the right code.





There is a subtle, but important difference between 302, 303 and 307 , which is not well reflected in the comic.

In short, the point is that when the 302 code was first created, it was incorrectly implemented by popular browsers. To eliminate the ambiguity between the correct 302 and the incorrect 302, codes 303 and 307 were created.


This comic book poorly illustrates the advantages of the 304th, since for a person “yes” is much shorter than “my answer has not changed.”

304 is useful for browsers because it signals that a resource can be loaded from the cache, rather than reloading it from the server.

400s: client error


The 4xx code class usually indicates a problem with the request. This may be a problem with the browser or the URL used.









404 is probably the most common mistake. Although many understand its meaning as “this resource does not exist,” and “this resource has been deleted,” 404 does not actually indicate whether the resource existed or will ever be returned.






Unlike the famous 404, 410 - this is the case when the resource existed, but was removed forever and its return is not expected. If you permanently delete a page from your site, you should use 410, not 404.



500s: server error











Epilogue


Finally, the funniest status code is a reference to the April Fool's joke of distant 1998, which is still alive .



Hyper Text Coffee Pot Control Protocol (HTCPCP, Hypertext Coffee Maker Control Protocol) is a protocol for controlling, tracking, and diagnosing coffee-making devices. HTCPCP requests are defined using the coffee: URI scheme and contain several additions to HTTP requests. 418 "I'm a teapot" (Error 418: I am a kettle) - returns when trying to make coffee with a kettle.

We hope that viewing these comics has made HTTP codes more interesting. Additional and more serious explanations about these codes can be found at the links below.

Related Links:

HTTP response status codes
HTTP Status Codes for Beginners | Added bytes
Simple language about HTTP

Source: https://habr.com/ru/post/349028/


All Articles