Get the App
SLTechnology News&Howtos  ›  Network Security  › 

HTTP Protocol (6) HTTP request method

Shulou Source: shulou.com Published: 2022-06-01 06:53:06 09月28日 Update

For the HTTP request message, here are some important things to know.

First of all, the more important thing in the request line is the request method. The request method is used to transfer data from the client to the server. There are mainly Get and Post methods.

The Get method sends data to the server through URL, so the data passed using the Get method is displayed in the browser address bar. Because browsers have limits on the length of the URL, the Get method is often used to send a small amount of data to the server. For example, the request header "GET index.php?id=1 HTTP/1.1" means that the client requests to access the index.php page of the server, and uses the Get method to pass the data "id=1" to the server. Id is a parameter defined in advance on the server side, and the value 1 is the data transmitted by the client. If you want to pass multiple parameters at the same time, the parameters are separated by &, such as id=1&name=admin.

The data to be sent by the Post method is placed in the body of the HTTP request message, so the passed data is not displayed in the browser address bar. It can be used to send a large amount of data to the server, such as user login, uploading files, submitting messages, and so on. Post method is used. A typical Post request message is shown in the following figure.

Example 1 BugKu web Foundation $_ GET

Link: http://123.206.87.240:8002/get/

After clicking on the link, the code is given directly, and the get method is used to receive the value of the what parameter. As long as the value of what is flag, you can get flag.

$what=$_GET ['what']; echo $what; if ($what=='flag') echo' flag {*

You can send data to the server directly through the address bar.

Example 2 basic BugKu Web $_ POST

Link: http://123.206.87.240:8002/post/

Similar to the previous question, the value of the what parameter is received using the post method.

$what=$_POST ['what']; echo $what;if ($what=='flag') echo' flag {*

This involves how to send data to the server through the post method. It is recommended to install the hackbar plug-in in your firefox browser by searching and installing it through the "add-ons" in the settings item.

After the installation is complete, you can call up hackbar by looking at either the element or F12. Then load the link and send the post data.

Tags: Methods data services servers parameters browsers links browsing addresses clients clients messages examples fundamentals importance between code elements typical content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Xiaomi Shulou Information Microsoft macOS