HTTP Status Codes
-
2xx Success
-
Code 200 - OK
-
Code 201 - Created
-
Code 204 - No Content
-
3xx Redirection
-
Code 301 - Moved Permanently
-
Code 302 - Found
-
Code 307 - Temporary Redirect
-
4xx Client Errors
-
Error 400 - Bad Request
-
Error 401 - Unauthorized
-
Error 403 - Forbidden
-
Error 404 - Not Found
-
5xx Server Errors
-
Error 500 - Internal Server Error
-
Error 502 - Bad Gateway
-
Error 503 - Service Unavailable
-
Error 504 - Gateway Timeout
All 2xx status codes mean "Hooray, your request worked perfectly!"
These codes indicate that the server received your request, understood it, and processed it successfully.

“OK” means everything went right—no hiccups, no drama. Think of it as the server high-fiving you!
Most web pages you load successfully are actually returning a 200 status under the hood.
1. Enjoy! If you see 200, you’re good to go. Nothing to fix here!
2. Validate your success. Developers often check for 200 to confirm an operation (like a form submission) worked properly.

Something new was successfully created on the server, like a brand-new user account or a new blog post. It’s like receiving a birth certificate for your data!
1. Confirm new resources. If you’re testing an API, make sure the new resource really exists (e.g., check a database or an ID in the response).
2. Celebrate! You successfully added something to the server.

The server did exactly what you asked, but there’s no body (no content) to send back. Think of it like a “silent success.”
For example, after deleting something, the server might say, “All done, but I have nothing else to show you.”
1. It’s not an error! No content just means there’s no message to return. Everything is still okay.
2. Verify logic if needed. If you expected data back, check your code or the API docs to see if 204 is indeed the intended response.
All 3xx codes mean “We moved your stuff” or “Try this other location.” Essentially, the server is redirecting you to a new URL.

This is a permanent redirect. It’s like your favorite café permanently changing address. Any future requests should go straight to the new URL.
1. Update your bookmarks or links. If you own the site, use 301 for SEO-friendly redirects. If you’re a visitor, note the new URL is the “official” home now.

This is a temporary redirect. Like a pop-up store that might go back to its original location later. Your browser automatically follows the new URL, but in theory, the old link might be used again in the future.
1. No big changes needed. If you’re a user, you just follow the redirect. If you own the site, ensure 302 is correct (and not 301) if it really is temporary.

Similar to 302, but more strict about re-sending the same HTTP method and data to the new location. Imagine you’re sending a package, and the post office says, “We’re rerouting it, but keep the same label and instructions.”
1. Relax, it’s still a temporary detour. The original link can become valid again once the redirect is gone.
2. Verify your redirect settings. If you’re the developer, 307 ensures that a POST request remains a POST when redirected, for example.
4xx errors indicate something went wrong on the client side (bad request, missing credentials, etc.).

When your browser (or application) sends a request to a server, it needs to follow specific rules (syntax). An Error 400 means the server didn’t understand what you asked because something wasn’t formatted correctly. Think of it like sending a letter with a broken envelope!
1. Double-check your URL. Typos or missing slashes can cause issues. Always verify carefully.
2. Correct your request parameters. If it’s an API, confirm the parameters and JSON format if needed.

You tried accessing a resource that requires valid credentials, but the server says: “I don’t see a valid ticket!”
1. Provide valid credentials. Make sure your username/password or token is correct and not expired.
2. API tokens often need refreshing. Check the docs or your code to ensure the token is current.

A 403 error is like a club that explicitly forbids your entry, even if you have valid ID. The server says: “I see who you are, but you’re not allowed here.”
1. Check privileges. You might need special permissions or an upgraded account.
2. Verify firewall or IP restrictions. Sometimes IPs are blocked for security reasons.

The classic “Page Not Found.” The resource may have been moved, deleted, or never existed at all.
1. Double-check the URL. A single typo can lead you astray.
2. Use the site’s search or sitemap. The page might have a new address.
5xx errors mean something went wrong on the server side (bug, overload, maintenance...).

The server encountered an unexpected condition that prevented it from fulfilling the request. Could be a bug or config issue.
1. If you’re a user: Wait or reload. The admin might fix it soon.
2. If you’re the admin: Check server logs or recent deployments for errors.

A server (acting as a gateway) got an invalid response from an upstream server. Like a broken phone line in a chain of calls.
1. Restart or verify services. If you have multiple layers (Nginx, Node, DB), ensure each one is running fine.
2. Check DNS or network settings. A misconfigured domain or firewall can cause 502s.

The server is temporarily unable to handle the request. Could be maintenance or high traffic.
1. Try again later. If it’s under maintenance, it’ll be back soon.
2. If you’re the admin: Scale resources or schedule maintenance off-peak.

The gateway server waited too long for a response from the upstream server. Like a phone call nobody answered in time.
1. Check upstream performance. The server might be overloaded or slow.
2. Increase timeout or fix bottlenecks. If large tasks take too long, optimize or raise time limits.