Day 23 - Saturday, Januray 23, 2021

Today was a busy day so i didn't learn anything new so I will just write a little post about a part of the web which made the web possible. I am talking about HTTP (Hyper Text Transfer Protocol).

So What is HTTP?

HTTP or Hyper Text Transfer Protocol is an application layer protocol for transferring of hypermedia like HTML documents which then we can access through a web-browser. HTTP is the foundation of the Web. HTTP was developed by Sir Tim Berners-Lee in 1989 at CERN.

How does HTTP works?

HTTP is a client server-protocol. It works the way that a recipient initiates an HTTP request to a server through a web-browser which opens the connection between the client and the server and HTTP waits for the response and after receiving the response the connection is closed or resued for more reqeusts. HTTP is a stateless protocol. A stateless protocol is a communication protocol in which the data between the requests made from the client to server is not stored.

HTTP Flow

Following are the steps HTTP takes to complete a request.

  1. Opens a TCP connection to send a request and receive a response.
  2. Sends an HTTP message which looks something like
GET / HTTP/1.1
Host: zainsci.github.io/blog
  1. Reads the response sent by the server which looks like
HTTP/1.1 200 OK
Date: Sat, 23 Jan 2021 16:59:32 GMT
Server: GitHub.com
Last-Modified: Fri, 22 Jan 2021 17:07:27 GMT
ETag: W/"600b064f-97ef"
Accept-Ranges: bytes
Content-Length: 9675
Content-Type: text/html

<!DOCTYPE html>
<html>
    <9675 bytes/>
</html>
  1. Close the connection or resue it for more requests.

The 200 in front of the HTTP/1.1 in the response above is a response code which means that everything went well.

HTTP Response Status Codes

HTTP Response Status Codes are divided into five groups and each code is a three digit code.

  • 1xx - Informational
  • 2xx - Successful
  • 3xx - Redirection
  • 4xx - Client Error
  • 5xx - Server Error

There is alot more to the HTTP that is not discussed here but that is all I can write for now. For more deep understanding of the HTTP look resources below.

What I Learned Today

💻 Porgramming

🗾 Langauge[日本語]

  • 背中 (せなか) Back. 背: Back, 中: Middle or Inside.
  • 人力車 (じんりきしゃ) Rickshaw, Human-Pulled Card. 人: Person, 力: Power, 車: Car.
  • 大気 (たいき) Atmosphere. 大: Big, 気: Spirit.
  • 汽車 (きしゃ) Train. 汽: Steam, 車: Car.

zainscizainsci