Photo by Denny Müller on Unsplash
HTTP, HTTPS & HTTP2 Explained
The one and last article to understand Essence of HTTP
If you ever started learning web development its impossible that you can skip something called HTTP. You can even say that this is the foundation or the fundamental of web development. In this blog we will try to explore HTTP, HTTPS and HTTP2. We will also dive into the differences between HTTP and HTTP2.
What is HTTP
HTTP stands for “Hyper Text Transfer Protocol“ that means a few protocols (rules) to transfer the Htext (Hyper Link Texts). Hyper Link Text simply means some kind of text or documents that refers to another text or document. In books, we know it as something called “References“ but in the modern world people barely use books and prefer to use Web Docs.
Now we can summarize that HTTP is just some set of rules that is used for transferring the data on the internet from browser to server or vice-versa.
Key Features of HTTP
Human Readable
HTTP was designed to be human readable. The requests and responses are in plain text so it becomes easier for developers to try and experiment things on HTTP with efficiency. Human Readability also helps developers to debug and understand the communication between browser and server better.
Stateless Protocol
Stateless is one of the key feature in HTTP that is designed so every time when user visits the web-page or he refreshes, he enters as new user. There is no memory saved of user’s previous request.
Request-Response Model
When a user search for anything in on the browser then its called request and the result sent by the servers known as responses. There is many types of requests e.g. GET, POST, DELETE etc. and every request gets the response as numeric code e.g. 200 (Success), 404 (Not Found). These numeric codes are standard provided by HTTP to maintain consistency on the Internet.
HTTP Headers
HTTP Headers are fundamental part of HTTP protocol. It contains meta data about every requests and responses. They are key-value pairs.
What is HTTPS
HTTPS is secured version of HTTP that stands for “Hyper Text Transfer Protocol Secure“. The uses and the working of the HTTPS is as same as HTTP but with an extra layer of security. HTTPS is used to communicate on internet between browser and server with security. HTTPS uses SSL (Secure Socket Layer) or TLS (Transport Layer Security) to secure the data travelling between browser and server. SSL or TLS encrypt the request in server then decrypts the response in the browser.
What is HTTP2
HTTP2 is an upgraded version of HTTP. It has some new features that HTTP doesn’t have. HTTP2 is far better than HTTP in terms of data security, efficiency and reliability but sometimes when HTTP2 is on holiday then HTTP does the full day duty of HTTP2.
Key Features of HTTP2
Multiplexing
HTTP2 allows many requests at once to be sent over a single connection simultaneously. This removes the hassle of having multiples connections to sent multiple files at once. Means multiple cars can go on single lane to same destination.
Compression
HTTP2 uses HPACK algorithm to compress HTTP Headers. That reduces the size of data while transferring from server to browser. It improves overall performance and efficiency. Means unnecessary parts of the car has been removed or compressed for more speed.
Security
HTTP2 uses HTTPS that comes with extra layer of security of SSL or TSL. So HTTP2 is also more secured in comparison with HTTP. Means you will get a police officer in a car for your security to until you didn’t reach to your destination.
How Browser Connects to Server
Setup TCP Connection
Exchange TLS Certificate
Send Verb + URL + Data
Gets the response back with status code and data (Image, CSV, Text etc.)
TCP Connection is closed (Stateless)