Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 14, 2022 01:18 pm GMT

What is HTTP?

I know that every one of you already has seen the word of HTTP in your life at least once.
Alright, but where? Lets check Googles link: https://www.google.com/.
As you can see the link starts with HTTPS and it represents the protocol that we use when requesting this website.

First of all, the thing that we should be aware of is that on the internet all the communication is done in request /response circles. So in the end, we use HTTP to make requests and get responses from servers.

And the process is like this:

  1. A client (a browser) sends an HTTP request to the web
  2. A web server receives the request
  3. The server runs an application to process the request
  4. The server returns an HTTP response (output) to the browser
  5. The client (the browser) receives the response
  6. So we understood what is HTTP used for.

Let me tell you about methods. We have methods that we refer to when we are making any request from the server every time. When we use HTTP protocol, not just the method we are referring to everything that is needed to proceed with that request every single time. This is because the HTTP protocol is STATELESS.

What is STATELESS : Stateless means, that when you had a request and got a response that request/response pair is separate from any other request that you are making or responses that you are receiving from the server. You can say like, that HTTP forgets everything about you when your request is done. And you have to refer to the needed data every time. And we call this kind of situation STATELESS.

If we get back to methods, main methods are:

  • GET: You want to receive data from the server
  • POST: You want to add your data to the server.
  • PUT: You want to update your data on the server.
  • DELETE: You want to delete something from the server.

Now, where exactly we are referring to these pieces of information like the method that we are using and the other needed ones when we are making requests to the server? Let me introduce to you the HTTP Headers.

There are so many headers that you can use. It has a so basic logic. It is just like a dictionary. Let me show you with example.

Lets say you want to visit https://www.google.com. For this mission, I am gonna use Developer Tools. You can reach this tool with a right-click on the website and click the inspect option. You are gonna see the Developer Tools!
There are so many other sub-tools in developer tools but I just want to show you the Network section, if you want to learn about others, you can search for it.

Image description

After opening the Network section, lets refresh our page so that the Network section can show us what is happening.

Image description

These are the HTTP requests we are making to google.com when we refresh the page. So lets just get a deep dive into the request that I chose one which is the HTML code for google.com main page.

Image description

As you can see right other you clicked on it. There is a Headers section. And there are request headers that our browser put, to get a valid response from the server. You can see them in the General Sub-Section. There, you can see the Status Code, which is just a number that comes from the server. The server is trying to tell us:

  • Everything is OK: 200
  • Not Found: 302
  • Bad Request: 400
  • Internal Server Error: 500And so many other numbers that tells us what is the Status of this request.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status for a more detailed explanation of the Status Codes.

There are also Response Headers that our browser needs these pieces of information to make this response valid and working.

Alrighty, we learned what HTTP is used for, what kind of protocol is HTTP (Stateless), and what are the HTTP Headers.

There is one more topic that I should tell you about.
In this blog, I used HTTP and HTTPS like they are the same thing but they are not. So let me tell you what that S means and why it is important.

It stands for the word Secure.
Now the case is, as you know the communication between you and the server is passing through so many other Routers, so this makes your communication insecure because your packets are almost naked on the internet! You have to cover them, by using Cryptograprafi. You have to make your packet just can be understandable to you, and the server that you are sending. So we are gonna use algorithms to make them secure by using Cryptograprafic Algorithms. That S at the end of HTTP tells us that, this server is proved that it has a certificate like TLS or SSL (The common ones that we use for this mission) that makes your connection secure between you and the server.
But I want to tell you that HTTPS doesnt mean that the server is trustable! It just tells you that, your data is just gonna be seen by the server that you are sending and not the other people who are trying to steal your data while your packet is on its journey to the server.

Congrats! You learned What is HTTP in a very detailed way.

For more blog about the internet, backend development, and Python check out my profile


Original Link: https://dev.to/burakuren101/what-is-http-16c3

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To