Facebook Pixel

Introduction to HTTP

The HyperText Transfer Protocol (HTTP) is the absolute foundation of data communication on the World Wide Web. Operating at the Application Layer, it strictly defines how messages are formatted and transmitted, and exactly how web servers and browsers should respond to various commands.

Whenever you click a link, submit a form, or open a webpage, HTTP is the protocol working behind the scenes on Port 80.

HTTP Request and Response

A basic visual overview of how HTTP requests and responses travel between a client and a server.

Core Characteristics

  • Client Server Model: HTTP relies on a strict request and response model. A client (like a web browser) sends an HTTP Request to the server. The server processes it and returns an HTTP Response.
  • Stateless Protocol: By default, HTTP is completely stateless. This means the server treats every single request as completely independent and retains absolutely no memory of previous requests. To fix this, developers use HTTP Cookies to manually maintain sessions, such as keeping a user logged into a website.
  • Connectionless Nature: In its earliest versions, HTTP was purely connectionless. The client would open a connection, send a request, and instantly disconnect. The server would then reconnect to send the response. Modern versions use Keep Alive headers to reuse connections and save time.

HTTP Request Methods

When a client communicates with a server, it must specify its exact intent using standard HTTP verbs.

  • GET: Requests data from a specified resource. For example, when you simply type a URL to read an article, your browser sends a GET request to download the HTML file.
  • POST: Submits data to the server to be processed. For example, when you fill out a login form with a username and password and click submit, a POST request securely carries that data to the server.
  • PUT: Updates an entire existing resource with new data.
  • DELETE: Requests the server to permanently remove the specified resource.

HTTP Status Codes

Every time a server responds to an HTTP request, it includes a three digit status code to explicitly communicate the result.

Code RangeCategoryCommon Example
1xxInformational100 Continue (The server received the initial part of the request).
2xxSuccess200 OK (The request succeeded and the data is enclosed).
3xxRedirection301 Moved Permanently (The requested page has a new permanent URL).
4xxClient Error404 Not Found (The requested page does not exist on the server).
5xxServer Error500 Internal Server Error (The server crashed or encountered a generic error).

HTTP vs HTTPS

Standard HTTP transmits all data in plain text, making it highly vulnerable to interception by hackers.

HyperText Transfer Protocol Secure (HTTPS) fixes this by wrapping the standard HTTP communication inside a secure, encrypted Transport Layer Security (TLS) tunnel on Port 443.

For example, an online banking application must explicitly use HTTPS. If it used standard HTTP, anyone monitoring the network could easily read the user's password and account numbers as they traveled across the internet.

Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.