I’ve seen someone ask this online, so I would like to share my answer.
The person asking further elaborated:
If I treat the server’s HTML, CSS, images, etc. as files transferred to the client and then assemble them for display, can I achieve the functionality of a webpage?
This is a seemingly simple question that can be a bit challenging to approach, as the HTTP protocol is so widespread and popular that both programmers and ordinary users have become somewhat oblivious to it. After looking at some responses, I feel that most of them missed the point and complicated a simple question.
One thing that needs to be clarified is that the issue HTTP addresses is not whether it can be done, but rather whether it is simple or easy to do.
The person asking the question believes that we must use a protocol because it solves problems that other protocols cannot, approaching the question of why to use the HTTP protocol from the perspective of “can it be done.” This is completely the wrong direction, and thus they cannot find the answer.
The answer is actually quite simple: we use HTTP because it greatly simplifies the transmission of network data in the form of web pages. To put it more simply, HTTP is simple and easy to use.
Additionally, understanding HTTP should not be done in isolation; at the very least, you should consider it in conjunction with HTML. Both start with ‘ht’, which stands for ‘Hyper Text’, and they have a collaborative relationship.
Let me give an example that everyone can relate to. Thanks to HTTP and HTML, I can teach elementary school students with no programming background to create a webpage with text and images in just one class period, and they can continue to build a website based on multiple web pages (of course, this only refers to static websites, not considering aesthetics, but focusing on basic information transmission).
Aside from the combination of HTTP and HTML that can achieve the above, what other technology stack can do this? And that is the reason why we use the HTTP protocol.