📜 ⬆️ ⬇️

How to learn http protocol

Today I want to talk about how I began to learn the basics of the HTTP protocol, resorting to manuals only in extreme cases. I don’t remember exactly why I needed to know how everything actually works, whether I wanted to spam some guilty forum, or if I had more noble goals (although what could be more noble than spamming an objectionable forum?) . Anyway, a thought has matured in my head: I need to know how the HTTP protocol works.

All my attempts to discuss this topic on the forums ended up being sent to manuals or much further. In the end, I gave up and decided to start an independent study of the issue.

To be honest, reading manuals has never been one of my strengths, usually on the second or third page I start to sleep, and after the tenth, I simply have no strength to fight this desire. After several attempts to read the manual, I reasoned like this: if the browser can send the necessary HTTP headers (HTTP headers), then it is necessary to steal these headers from it, and not nod over the endless documentation. Having shown a little ingenuity, I found a very simple way to get what you want.
')
Suppose I need to know which POST request forms the browser when sending a completed web form. Then, to find out all the information that interests me, you need to do this:

1. Create a small PHP script that will run on a local machine to listen on port 80. The peculiarity of the script is that it dumps all the data on the screen, without hiding anything from my inquisitive gaze;
2. In the browser, open a page with a web form of interest to us (this should be something like www.some-url.com/webform.html );
3. Fill in all fields of the form;
4. Open the hosts file (on Linux, this file is located at / ets / hosts, and on Windows, look for yourself, God knows where the cunning guys from Melkosoft could stick it. Those who find it can unsubscribe in the comments! :-)))) . At the end of the file you need to add: 127.0.0.1 www.some-url.com
5. Return to the browser and click the “Submit” button (or what button is there to submit the form)

Actually that's all! As a result, the naive browser will send the form not to www.some-url.com , but to our script, which, in turn, will display everything on the screen. We will only have to analyze the data obtained (we cannot do without a manual here, but, you see, it is much easier to see a couple of parameters than to wool several dozen pages).

Probably you will ask a question, are there any other ways to get headlines? Of course there is, for example, you can use a sniffer, or, say, special plug-ins for your favorite barser. But my method is also very good, and here's why:
1. It is simple! Even a first grader can easily do all the described procedures;
2. It is independent of the browser, ultimately the HTTP protocol is not alive by the browsers alone, there are also RSS readers and other similar programs;
3. It is a cross-platform, unconditional plus!
4. It allows you to get the headlines “as is” and transfer it to your program with a simple copy-paste;
5. It opens up extensive opportunities for analysis and experimentation.

Actually, that's all.

- The original HTTP protocol is just

Source: https://habr.com/ru/post/13978/


All Articles