DEV Community

[Comment from a deleted post]
Collapse
 
sleeplessbyte profile image
Derk-Jan Karrenbeld • Edited

I don't want to rain on your parade but I don't understand what the purpose of this article is. I was looking forward to a detailed explanation of these status codes (I think it's very valuable to explain them 👌👍), but instead the explanations don't actually explain anything and are, IMO, more cryptic than the Wikipedia / RFC 7231 explanations.

The article further is littered with "suggested readings" and "recommended articles" and I did actually went and read them, and none of them have anything to do with HTTP status codes. I don't quite understand why they are there in the first place as it only detracts from the value of the article.

A few examples and rectifications:

400 Bad Request
It means that the Server did not understand the request from Client.

This is incorrect! A Bad Request means that the server can not or will not process the request because it understands that there is a client error. Usually this happens when a request is malformed, invalid or seems deceptive.

401 Unauthorized
It means that the requested resource is username/password protected.

There are many ways in HTTP to authenticate yourself that don't require a username or password, at all. The unauthorized status means that the request lacks valid authentication credentials. It doesn't (by the status alone) say anything about the credentials itself. For example, an URL might require a Bearer token* (which may be generated using something completely different than a username and/or password).

404 Not Found
It means that the Server is unable to find the requested page.

There is no concept of "pages" in the HTTP specification. There are resources and their representations. Various headers dictate which representation should be returned in the response (this is known as content-negotiation, and it happens for example, based on the path, on the Accept and Accept-XXX headers, etc.). A 404 indicates that the server did not find or not willing to disclose the existence of the resource for the current representation. This distinction is very important and goes much further than a "page that does not exist".

(I stopped after these three, I hope my point is clear)

My biggest issue with this article is that especially beginners might take it for granted and get stuck with the misinformation. I think a lot of this can be solved by adding appropriate wording and/or examples!

Collapse
 
full_stackgeek profile image
Full Stack Geek

Hey Derk,
Thanks for your detailed feedback. The points you have raised seems great and I promise to include your suggestions/corrections into my article. Readers like you are actually gem for the community
Thanks,
Full Stack Geek