Home > Article > Backend Development > What is the maximum length of data transferred by GET and POST_PHP Tutorial
In various web development languages, data is basically transferred between each page. The more commonly used data transfer methods in web development are get post. Until now, I have only known that the amount of data transferred by get is larger than The amount of data transferred by post is smaller, so you still need to use post to transfer large amounts of data. But how much data can the maximum amount of data transferred by get post be? Never figured it out.
Due to work needs today, I have to figure this issue out. Let’s talk about the maximum length of data transmitted by GET and POST.
get submits data through URL, so the amount of data that can be submitted by GET is directly related to the maximum length that the URL can achieve. Many articles say that the data submitted through GET can only be up to 1024 bytes. In fact, there is no upper parameter limit for URLs, and the HTTP protocol specification does not limit the URL length. This limit is imposed by specific browsers and servers. IE's limit on URL length is 2083 bytes (2K+35 bytes). For other browsers, such as FireFox, Netscape, etc., there is no length limit. At this time, the limit depends on the server's operating system. That is, if the URL is too long, the server may reject the request or make an incomplete data request due to security settings.
Theoretically, there is no size limit for post, and the HTTP protocol specification does not impose any size limit. However, in fact, the amount of data that post can transmit depends on the server settings and memory size. Because the data volume of our posts rarely exceeds MB, we rarely feel the limit of the data volume of posts. However, in practice, if you upload files, you may find such a problem, that is, uploading relatively large files. When the file is sent to the server, it may not be uploaded. In PHP language, when checking the reason, you may see that there are parameters related to PHP uploading files. PHP has a limit on uploading by default. Generally, this value is 2MB. Change this value. You need to change the value of post_max_size in php.conf. This clearly illustrates the problem.