About Lesson
HTTP Status Codes
HTTP status codes are 3-digit numbers returned by a server to indicate the result of an HTTP request.
1xx – Informational Responses
These indicate that the request has been received and is still being processed.
- 100 Continue → Server received request headers, continue sending body.
- 101 Switching Protocols → Client requested a protocol change (e.g., WebSockets).
2xx – Success Responses
The request was successfully received, understood, and processed.
- 200 OK → Request was successful.
- 201 Created → A new resource was successfully created (e.g., after a POST request).
- 202 Accepted → Request accepted but not yet processed.
- 204 No Content → Request was successful, but there is no response body.
3xx – Redirection Responses
The client must take additional action to complete the request.
- 301 Moved Permanently → The resource has moved to a new URL permanently.
- 302 Found → Temporary redirection to another URL.
- 304 Not Modified → The cached version is still valid (no need to download again).
4xx – Client Errors
The request contains errors or the client doesn’t have permission.
- 400 Bad Request → Request has invalid syntax.
- 401 Unauthorized → Authentication is required (e.g., missing or invalid token).
- 403 Forbidden → Client does not have permission (even if authenticated).
- 404 Not Found → Requested resource does not exist.
405 Method Not Allowed → HTTP method (GET, POST, etc.) is not allowed for this resource.
5xx – Server Errors
The server failed to fulfill a valid request.
- 500 Internal Server Error → General server error.
- 502 Bad Gateway → Server received an invalid response from the upstream server.
- 503 Service Unavailable → Server is temporarily unavailable (e.g., maintenance).
- 504 Gateway Timeout → Server didn’t receive a response in time from another server.