Understanding the Language of the Web

Understanding the Language of the Web

HTTP, Web Protocols, and Jargon Simplified

What is HTTP?

HTTP stands for HyperText Transfer Protocol. It's the foundational communication method that your web browser (like Chrome, Firefox, or Edge) uses to interact with websites.

Think of it as a postman delivering your messages (requests) to a website’s server and bringing back the website's reply (response). 📬

Key Feature: Stateless Protocol

HTTP is called a stateless protocol because it doesn’t remember anything! Every time you send a request, the server treats it as a brand-new conversation. Imagine introducing yourself every single time you ask someone a question. This simplicity makes HTTP fast but also requires additional mechanisms like sessions to keep track of users.


What Are Sessions? 🛠️

Sessions are like a memory aid for websites. Since HTTP doesn’t remember previous interactions, sessions help servers keep track of who you are and what you’re doing on the website. Here’s how it works:

  • When you log into a website, the server assigns a session ID to identify you.

  • This session ID is stored in a cookie on your browser or maintained on the server.

  • The session lasts until you log out, close the website, or the session expires.

Sessions are crucial for personalized experiences, like keeping you logged into your account or remembering items in your shopping cart.


HTTP Headers

HTTP headers are kye-value pair. like labels on a package, providing extra details about the request or response. They help servers and browsers communicate effectively. Let’s explore some common headers:

  • Content-Type: Specifies the format of the data being sent (e.g., JSON, HTML, image).

  • Authorization: Contains login credentials or tokens to verify your identity.

  • Cache-Control: Tells the browser whether it should store (cache) the response for quicker access later.

  • User-Agent: Identifies the browser or app making the request.

  • Accept: Specifies the types of data the client can process (e.g., text/html).

Headers are essential for customizing the behavior of web communications.


HTTP Requests and Responses

When you interact with a website, two main actions occur:

  1. HTTP Request: Your browser sends a request to the server asking for data (like a webpage or image).

  2. HTTP Response: The server sends back the requested data or an error message.

Request Methods (Types):

  • GET: Retrieves data (e.g., visiting a webpage).

  • POST: Sends data to the server (e.g., submitting a form).

  • PUT: Updates existing data.

  • DELETE: Deletes data on the server.

Response Status Codes 🛑✅

HTTP responses include status codes to indicate the result:

  • 1xx Informational: "Hold on, I’m working on it."

  • 2xx Success: "Everything is good!" (e.g., 200 OK).

  • 3xx Redirection: "Look somewhere else for this."

  • 4xx Client Error: "You made a mistake." (e.g., 404 Not Found).

  • 5xx Server Error: "I messed up." (e.g., 500 Internal Server Error).


HTTP vs HTTPS 🔒

  • HTTP: Plain text communication with no encryption.

  • HTTPS: Secure communication with encryption, using TLS (Transport Layer Security) or SSL (Secure Sockets Layer).

Why Use HTTPS?

  • Encrypts data to protect it from hackers.

  • Improves trust (websites with HTTPS show a padlock in the browser).

  • Required for handling sensitive information like passwords and payments.


HTTP Versions Over Time 📜

HTTP has improved significantly since its creation:

  • HTTP/1.1: Introduced persistent connections to handle multiple requests efficiently.

  • HTTP/2: Added multiplexing to allow multiple requests simultaneously, speeding up websites.

  • HTTP/3: Uses QUIC protocol for even faster and more reliable communication.


AWS and HTTPS Internal Communication

In cloud computing, like with Amazon Web Services (AWS), https is not used. as they provide encryption on their internal co


Web Jargon

  • User Agent: This refers to the browser or app (e.g., Chrome, Safari, or a mobile app) that’s making the HTTP request. It tells the server what kind of device or software is being used, enabling the server to customize its response (e.g., showing a mobile-friendly site for a smartphone user).

  • FTP (File Transfer Protocol): FTP is a protocol designed specifically for transferring files between computers over the internet. Think of it as a digital courier service. For example, web developers use FTP to upload website files from their computer to a web server. It requires authentication (username and password) to access files securely.

  • TCP (Transmission Control Protocol): TCP ensures that data sent over the internet is delivered accurately and in the correct order. Imagine sending a book page by page; TCP ensures no pages are missing or out of sequence. It’s a core protocol of the internet, working with IP (Internet Protocol) to form the backbone of online communication.

  • What is TCP/IP? | Cloudflare

  • URL (Uniform Resource Locator): A URL is the web address you type into your browser to visit a site, such as https://example.com. It’s like the street address of a website, guiding your browser to the correct server and resource. A URL is made up of components like the protocol (https), domain name (example.com), and sometimes a path (/about-us).

  • IP Address: An IP address is a unique identifier assigned to every device on the internet, much like a postal address. For instance, 192.168.1.1 might identify a specific device in a local network. It allows devices to find and communicate with each other across the web.

  • Understanding IP Addresses: A Complete Guide to Internet Protocol

  • DNS (Domain Name System): DNS acts like a phonebook for the internet. It translates human-friendly domain names (like google.com) into numerical IP addresses (like 142.250.190.78). This allows users to access websites without needing to remember complex strings of numbers.

What every IT engineer must know about (DNS) Domain Name System | by  Saurabh Rohankar | Medium

  • Header: HTTP headers contain metadata sent with requests or responses. Think of them as the "From" or "Subject" lines in an email, providing extra details. For example, a header might specify the type of data being sent (like application/json) or include authentication tokens.

  • Index of /images/screenshots/http-config

  • Payload: The payload is the actual data being transmitted in the body of an HTTP request or response. For example, when submitting a form on a website, the payload contains the form data (like your name and email).

  • Cache: A cache is a temporary storage mechanism that saves copies of web pages, images, or other resources. This speeds up future access to the same resources. For instance, when you revisit a site, your browser might load cached images instead of downloading them again, reducing loading times and saving bandwidth.