DEV Community

Sharmila devi
Sharmila devi

Posted on

Write a blog on "How a request originates from cllient and reaches the server ?"

Whenever I open a website or click on a link, I usually don’t think about what happens behind the scenes. But actually, there is a simple and interesting process that takes place in just a few milliseconds. Let me explain it in an easy way.

First, everything starts from my side, which is called the client. When I type a URL in the browser or click a link, my browser creates a request asking for that webpage.

Next, the browser needs to find where that website is located. Since computers don’t understand names like google.com, it uses something called DNS (Domain Name System). DNS converts the website name into an IP address, which is like the real address of the server.

After getting the IP address, my browser tries to connect with the server. Once the connection is successfully established, the browser sends the request. This request is usually called an HTTP request, which simply means asking the server to send the required data.

Now, the server receives my request and starts processing it. It may check files, run some backend code, or even fetch data from a database. Based on my request, the server prepares the correct response.

Once everything is ready, the server sends the response back to my browser. This response contains the webpage data like HTML, CSS, and JavaScript.

Finally, my browser takes this response and displays the webpage on my screen. This is the moment when I actually see the website.

Even though all these steps sound long, they happen very quickly, almost instantly. This is how a request travels from the client to the server and comes back as a response every time I use the internet.

Top comments (0)