HTTP status codes are mentioned a lot, especially when working with REST API. You stumble upon them in conversations with your backend colleagues or during debugging of a failing server request. Unfortunately, I’m still having troubles with remembering the meaning of these codes, so today I decided to come up with some fun mnemotechniques, that will help me (and you) to stop Googling each status code every time!
Congratulations! Your request succeeded!
This status code indicates, that a requested resource was moved to other location. It also gives you the URL to this location, so that you can redirect.
The server could not process your request, because it is malformed. It can just be a typo (e. g. server is looking for “mediaId” and you’re giving it “mediaid” instead).
In this case your request lacks valid authentication credentials (try to log in first).
The server won’t give you what you’re looking for, because you don’t have required privileges. For example you want to access posts, which only admin can browse.
Server could not find the requested resource. Usually the URL you’re providing is bad.
The server encountered unexpected error. Try to talk with your backend colleagues to see what’s going on. In this case, you can be sure it’s not your fault - the server is crashing internally.