Lesson 2 | HTTP |
Objective | Explain the Purpose of the HTTP Protocol and common HTTP Error Codes |
Purpose of HTTP Protocol and common HTTP Error Codes
The Hypertext Transfer Protocol (HTTP) is the underlying communications protocol of the Web and is therefore considered the backbone of the Web.
It is the protocol that manages the exchange of resources between clients, namely Web browsers, and servers. Web browsers primarily use HTTP
to download documents created in Hypertext Markup Language (HTML);
they also use HTTP to transfer files and other data across the network. HTTP is the default protocol for TCP/IP and facilitates the transfer of data into any
browser. For example: if you type http://www.excite.com or if you simply type www.excite.com you will still get the requested Web page displayed in the browser, but HTTP (along with HTML) did all the work.
HTTP defines methods for:
- Requesting resources through URLs
- Returning error codes to the user
Common Error Codes which appear with HTTP Transactions
What are some of the common error codes which appear with HTTP transactions?
There are a set of "common HTTP error codes" that pop up a lot during web transactions.
Here's a
quick breakdown, grouped by category:
🔵 1xx: Informational responses (rare to see directly)
- 100 Continue** — Server has received the request headers, client should continue with request body.
🟢 2xx: Success (not errors, but important)
- 200 OK — Standard success for a request.
- 201 Created — A new resource was successfully created (POST request).
- 204 No Content — Success but no content to return (e.g., DELETE request success).
🟡 3xx: Redirection messages
- 301 Moved Permanently — Resource has permanently moved to a new URL.
- 302 Found — Temporary redirect (commonly misused).
- 304 Not Modified — The cached version is still valid, no need to resend.
🔴 4xx: Client Errors (user side issues)
- 400 Bad Request — Server couldn’t understand the request due to malformed syntax.
- 401 Unauthorized — Authentication required or has failed.
- 403 Forbidden — Server understood the request but refuses to authorize it.
- 404 Not Found — Requested resource could not be found.
- 405 Method Not Allowed — The HTTP method used (e.g., POST, GET) is not allowed for this resource.
- 408 Request Timeout — Client took too long to send the request.
- 429 Too Many Requests — Rate limiting; client is making too many requests in a short time.
🔴 5xx: Server Errors (server side issues)
- 500 Internal Server Error — Generic server error, unexpected condition.
- 501 Not Implemented — Server doesn't recognize or support the method.
- 502 Bad Gateway — Server received an invalid response from an upstream server.
- 503 Service Unavailable — Server is currently unable to handle the request (overload, maintenance).
- 504 Gateway Timeout — Server didn't get a timely response from upstream server.
⭐ Quick Tip:
- If you ever see 4xx — it's usually something wrong with the request.
- If you see 5xx — it's usually something wrong with the server.
Computer and Internet Security
HTTP Error Codes
HTTP error codes indicate the status of HTTP transactions. This lesson does not teach you how to fix the problems, but it does tell you what the error codes mean.
Error codes help identify the result of a client request. For example, if you type https:///www.yahoo.com and the site does not appear in your browser, there could be an HTTP problem. HTTP uses certain codes to easily pinpoint the problem. Generally, codes starting with 4, for example 4xx, are indicative of a client-side error and codes starting with 5, for example 5xx, are indicative of a server-side error. The table below lists the error codes and their corresponding messages.
Determining the category of the problem is important for assessing the problem's severity and priority in fixing it.
Once you discover a problem, then it really becomes a matter of whether you are authorized to diagnose it yourself.
If you are not authorized to diagnose the problem or if it's a problem affecting multiple users, then you should escalate the problem to the Internet access provider or to the network administrator. In the next lesson, you will learn the purpose of FTP.
CODE CLASS |
STATUS |
EXAMPLE |
4xx: Client Error (Request contains bad syntax or the server cannot fulfill the request.) |
400 |
Bad request from client. |
401 |
Unauthorized request. |
402 |
Payment required for request. |
403 |
Resource access forbidden. |
404 |
Resource not found. |
405 |
Method not allowed for resource. |
406 |
Resource type not acceptable. |
410 |
Resource not available. |
5xx: Server Error (Server failed to fulfill an apparently valid request.) |
500 |
Internal server error. |
501 |
Method not implemented. |
502 |
Bad gateway or server overloaded. |
503 |
Service unavailable or gateway time-out. |
|
504 |
Secondary gateway or server time-out. |
