What is HTTP and HTTPS?

Rishabh Singh
4 min readJan 22, 2023

Understanding from basics.

Photo by Haley Walden

HTTP (i.e., Hypertext Transfer Protocol) is a client-server protocol which allows fetching of resources, such as HTML documents.

| Let’s Understand this…

I am aware that at first glance this may appear to be complicated, but it is not. Knowing client-server communication is essential to comprehending the aforementioned definition. In light of this, let’s examine what client-server communication actually means.

| Why was it designed?

Although it was initially designedto get HTML pages, HTTP has since seen significant refinement and has expanded significantly. These days, it is used to transfer a wide range of data, including photos, videos, audio, and documents.

| Features of HTTP

  1. Any sort of media content can be transferred over HTTP, provided that both the server and the client can process it. This is known as being media independent.
  2. HTTP is a connectionless protocol: The HTTP client, which is often a browser, starts HTTP requests. After sending the requests, the client disconnects from the server and waits for the response.
  3. Because HTTP is stateless, just the current request is shared between the client and server. They both eventually forget about one another. Since the protocol is stateless, neither the client nor the server can keep track of various requests made across different web pages.

| Role of HTTP in client-server communication

Well, a language or method of communication is required for client-server communication, and HTTP serves this purpose for both the client and the server. HTTP is a protocol, or a set of guidelines, that allows the client and server to communicate with one another. Request messages are those sent by the client (the browser), whereas response messages are those delivered by the server.

| Types of methods that HTTP handles

a) Request

b) Response

Image credit: RYAN

1. Request

Request Line, Request Header, and Request Body are the three components that make up an HTTP request.

a) Request line

The method is specified, informing the server how to use the data or resource.
The resource on the server can be located using this information’s request URL.
Additionally, it provides the current HTTP protocol version.

b) Request Header

The request headers are used to send additional information about the request so that the server is aware of how to respond to the client’s request for data.

c) Request Body

Additional data can be sent to the server using this optional component of the HTTP request.

2. Response

The HTTP Response is the server’s reply that aims to give the client the requested resources. Let’s examine what’s inside the server’s response…

a) Status Line

Finding HTTP/1.1 302 The response header’s status line appears as shown. It includes the version of the HTTP protocol, the status code, and the reason (known as status text).

b) Response Header

One or more response header lines may exist, and they are used to send extra data from the server to the client.

c) Response Body

The resource that the client requested is contained in the response body. The reason for the error and, maybe, the steps the client needs to do to successfully complete the request are contained in the response body if the request is unsuccessful.

SSL Encryption

A security mechanism for the Internet based on encryption is known as SSL, or Secure Sockets Layer. To provide privacy, authentication, and data integrity in Internet communications, Netscape created it for the first time in 1995. The present TLS encryption now in use predates SSL.

Image Source: Internet

| How does SSL work?

SSL encrypts data that is sent across the web in order to offer a high level of privacy. As a result, anyone attempting to intercept this data will only be able to make out a jumbled collection of characters that is incredibly difficult to decrypt.
In order to make sure that both communicating devices are indeed who they say they are, SSL starts an authentication procedure between them known as a handshake.
In order to provide data integrity and ensure that the data has not been tampered with before reaching its intended receiver, SSL additionally digitally signs data.

| Importance of SSL

Data on the Web used to be sent in plaintext, which meant that anyone could read it if they intercepted the communication. For instance, if a customer went to a shopping website, made a purchase, and entered their credit card information, that information would be transmitted across the Internet in clear view.

SSL was developed to address this issue and safeguard user privacy. SSL makes sure that anyone who intercepts the data can only see a jumbled mess of characters by encrypting any data that travels between a user and a web server. The credit card number submitted by the customer is now secure and only accessible by the purchasing website.

SSL also prevents specific cyberattacks: It verifies web servers, which is crucial because hackers frequently attempt to create phoney websites in order to deceive consumers and steal data. Like a tamper-proof seal on a medication container, it likewise prevents attackers from altering data while it is being transmitted.

--

--