The reason is that the get method is passed through the URL, while the URL length is limited, and the POST method uses the stream method. Theoretically, there is no limit on the capacity that can be passed.
Now let's look at this description: "The URL length is limited." Where is the limit? What about browser or server? The results from Google show that the URL length is actually restricted by browser, for example, the URL Length of IE is 2083 bytes, opera is 4050, and Netscape is 8192. It is said that the HTTP protocol itself has no limit on the length of the get method. If you do not use a browser Program If httprequest is sent in, can the length of get be infinite? With this idea, we conducted the following experiments:
On the client side, implement it in Java, send httprequest to the server side, and use the get method.
On the server side, design an Apache module and output strlen (R-> ARGs) with ap_rprintf as response to return to the Java side.
By increasing the length of the string passed by the get method, it is found that when the URL length exceeds 8208 bytes, Java throws Io exception: server returned HTTP response code: 414 for URL :.....
What error does 414 mean?
414-request-URL too long (see: http://www.websitepulse.com/kb/4xx_HTTP_status_codes.html)
It can be seen that there is a limit on the URL length on the server side, so there is a limit on the data that can be transmitted by the get method. However, this restriction may vary depending on the server's processing capabilities, or where to configure it. (I started to guess again. This doesn't seem to be a good habit ).
The following is a preparation:
In fact, this is understandable, and there is no limit on the URL length. After all, the HTTP protocol is UDP, while a UDP package is limited in size. So why can post transmit large volumes of data? I have no deep understanding before trying to read Post Data in the Apache module. It's just a stream. In fact, the post data is read in parts during parsing. If you understand it from the UDP perspective, you can divide it into multiple UDP packets and then read them one by one.