Glossary Term
HTTP Status Code
Learn what HTTP status codes are and how they indicate request results. Understand 1xx, 2xx, 3xx, 4xx, and 5xx code classes with common examples.
TL;DR: A three-digit number indicating the result of an HTTP request (2xx success, 4xx client error, 5xx server error). Enables proper error handling and user experience.
An HTTP status code is a three-digit number that tells you what happened with your HTTP request. Think of it like a traffic light - it gives you an instant visual cue about whether things went well or if there’s a problem.
Status codes are grouped into five categories based on their first digit:
- 1xx (Informational): “Hold on, still processing”
- 2xx (Success): “Everything worked perfectly”
- 3xx (Redirection): “Look somewhere else”
- 4xx (Client Error): “You made a mistake”
- 5xx (Server Error): “We made a mistake”
Status codes are crucial because they help browsers, apps, and developers understand what happened without having to parse the entire response. They enable proper error handling and user experience.
Examples:
- 200 OK: Your request succeeded and here’s your data
- 404 Not Found: The page or resource you requested doesn’t exist
- 500 Internal Server Error: Something went wrong on the server’s end
Related terms: HTTP Response, HTTP Request, Error Handling
Frequently Asked Questions
What is an HTTP status code?
A status code is a 3-digit number in HTTP responses indicating the result. 2xx means success, 3xx redirect, 4xx client error, 5xx server error.
What does 200 OK mean?
200 OK means the request succeeded. The server processed it correctly and is returning the requested data or confirmation.
What does 404 Not Found mean?
404 means the server cannot find the requested resource. The URL may be wrong, the page deleted, or the link broken.
What does 500 Internal Server Error mean?
500 means something went wrong on the server. It is a generic error when the server cannot be more specific about what failed.