What is the Internet, HTTP, and HTTPS?6 min read

The Internet now is a dispensable part of every one life’s, it helps you do stuff online and instead of queuing on the grocery or supermarket, with just a few clicks with your phone now, you can buy stuff far easier. Before we dive into what is HTTP, we should consider what is the internet first.

The Internet is actually just a collection of WANs (Wide Area Network), and LANs (local area network).

LAN – A network of computers in a single building or in close proximity

WAN – A network in which computer devices are physically distant from each other, typically spanning cities, states, or even continents.

And, if you want to connect to the internet, you can get assistance from Internet Sevice Provider (ISP), the company will be responsible for providing you a router – a device or software in a computer that determines the next network point to which a packet should be forwarded. Or you just easily can access the internet through WLAN (Wireless local area network) and most commonly know as Wi-Fi or WiFi, is a technology for radio wireless local area networking of devices based on the IEEE 802.11 standards through an access point – POP (Point of presence) also called hotspots.

Learning fundamental concepts of the internet such as TCP/IP, OSI model, IP, subnet, DHCP, FTP, POP3, SMTP is crucial, but on this limited article, we will just dig more about HTTP and some concepts around it. All of these others will be explained in other articles.

What is HTTP?

In the old day of the internet, files were transferred between two or more different computers by using FPT (File Transfer Protocol) and some other old protocols, this is really tedious and also inefficient. This is the reason why on one beautiful day in 1990, researcher and scientist from the UK came up with the idea of the World Wide Web (WWW), the primary idea is a web browser and a web server and HTTP is a crucial protocol that is responsible for web browser and web server can “talk” to each other.

HTTP is abbreviated of Hypertext Transfer Protocol, scientifically, the Hypertext Transfer Protocol is an application protocol for distributed, collaborative, and hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web.

You could imagine what it is by typing something on your search bar, after you hit enter, the browser will send a request through the HTTP protocol to the webserver. The web server will receive this request and return the result to the web browser.

HTTPS

HTTPS (HTTP Secure) is an encrypted version of the HTTP protocol. It usually uses SSL (Secure Sockets Layer) or TLS (Transport Layer Security) to encrypt all communication between a client and a server. This secure connection allows clients to safely exchange sensitive data with a server, for example for banking activities or online shopping. Actually, HTTPS now is everywhere, even in my blog! You shouldn’t type any sensitive pieces of information if the site you’re surfing on is not encrypted. You can check whether or not it is the HTTPS or HTTP by observing and clicking on the left corner of the search bar.

HTTPS (Secure)

HTTP (not secure)

You can also expand this section to see more about the certificate of the website you are currently in, the cookies this website uses and more.

HTTP cache

The performance of web sites and applications can be significantly improved by reusing previously fetched resources. Web caches reduce latency and network traffic and thus lessen the time needed to display a representation of a resource. By making use of HTTP caching, Web sites become more responsive.

A web cache is information technology for the temporary storage of web documents, such as HTML pages and images, to reduce server lag.

HTTP cookie

An HTTP cookie (web cookie, browser cookie) is a small piece of data that a server sends to the user’s web browser. The browser may store it and send it back with the next request to the same server. Typically, it’s used to tell if two requests came from the same browser — keeping a user logged-in, for example. It remembers stateful information for the stateless HTTP protocol.

HTTP headers

HTTP headers allow the client and the server to pass additional information with the request or the response. An HTTP header consists of its case-insensitive name followed by a colon ‘:‘, then by its value (without line breaks). Leading white space before the value is ignored.

HTTP request methods

  • GET

The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.

  • POST

The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.

There are several other methods but for now, we should focus on 2 common methods above.

HTTP response status codes

HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes: informational responses, successful responses, redirects, client errors, and servers errors.

Common methods

  • 200 OK
  • 201 Created
  • 400 Bad Request
  • 401 Forbidden
  • 404 Not Found
  • 405 Method Not Allowed
  • 422 Unprocessable Entity

Cross-Origin Resource Sharing (CORS)

Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP headers to tell a browser to let a web application running at one origin (domain) have permission to access selected resources from a server at a different origin. A web application makes a cross-origin HTTP request when it requests a resource that has a different origin (domain, protocol, and port) than its own origin.

An example of a cross-origin request: The frontend JavaScript code for a web application served from http://domain-a.com uses XMLHttpRequest to make a request for http://api.domain-b.com/data.json.

HTTP Messages

HTTP messages are how data is exchanged between a server and a client. There are two types of messages: requests sent by the client to trigger an action on the server, and responses, the answer from the server.

Conclusion

Internet is a crucial part for most of the human being, as a computer science student and some related areas. Knowing the fundamental concepts of the internet and also its protocols is necessary. HTTP is an internet protocol which has the mission to make the web server and a web browser can talk to each other. HTTPS is a secure version of HTTP, every endpoint is always encrypted. Most of the websites of the internet use cookies to improve user experience and save your information without re-entering it for a while. Two most common HTTP requests are GET and POST.

Previous Article
Next Article
Every support is much appreciated ❤️

Buy Me a Coffee