DEV Community

Cover image for What is status codes (200, 404, 500)?
Gowtham Kalyan
Gowtham Kalyan

Posted on

What is status codes (200, 404, 500)?

When a client (like a browser or API tool) sends a request to a server, the server responds with a status code. This code tells you:

πŸ‘‰ β€œWhat happened to your request?”


What is an HTTP Status Code?

An HTTP status code is a 3-digit number returned by the server to indicate the result of a request.


1. 200 OK – Success βœ…

200 means the request was successful.

When you see 200:

  • Data fetched successfully
  • Request processed correctly

Example:

```http id="s1"
GET /users/101 β†’ 200 OK




πŸ‘‰ User data returned successfully

---

##  2. 404 Not Found – Resource Missing ❌

**404** means the requested resource was **not found on the server**.

###  When you see 404:

* Wrong URL
* Resource doesn’t exist
* Invalid ID

###  Example:



```http id="s2"
GET /users/999 β†’ 404 Not Found
Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ User doesn’t exist


3. 500 Internal Server Error – Server Issue ⚠️

500 means something went wrong on the server side.

When you see 500:

  • Code error (NullPointerException, etc.)
  • Server crash
  • Unexpected failure

Example:

```http id="s3"
POST /users β†’ 500 Internal Server Error




πŸ‘‰ Server failed to process request

---

##  Quick Comparison

| Status Code | Meaning      | Type            | Example Scenario          |
| ----------- | ------------ | --------------- | ------------------------- |
| 200         | Success      | βœ… Success       | Data fetched successfully |
| 404         | Not Found    | ❌ Client Error  | Invalid URL/resource      |
| 500         | Server Error | ⚠️ Server Error | Bug in backend            |

---

##  Status Code Categories

All HTTP status codes fall into 5 groups:

| Range | Category      | Meaning               |
| ----- | ------------- | --------------------- |
| 1xx   | Informational | Request received      |
| 2xx   | Success       | Request successful    |
| 3xx   | Redirection   | Further action needed |
| 4xx   | Client Errors | Problem with request  |
| 5xx   | Server Errors | Problem on server     |

---

##  Real-Time Example

Imagine using a website:

* Page loads β†’ **200 OK** βœ…
* Page not found β†’ **404 Error** ❌
* Site crashes β†’ **500 Error** ⚠️

---

##  Why Status Codes Matter

* Help debug issues quickly
* Improve API design
* Provide clear communication between client & server
* Essential for frontend-backend interaction

---

##  Conclusion

HTTP status codes are a critical part of web communication. Understanding codes like **200, 404, and 500** helps developers build and debug applications effectively.

---

##  Learn More

Want to master REST APIs, Spring Boot, and backend development?

πŸ‘‰ **[No 1 Core JAVA Online Training in 2026](https://ashokitech.com/core-java-online-training/)**


---

Enter fullscreen mode Exit fullscreen mode

Top comments (0)