As per HTTP protocol specifications, client browsers send http post requests in two-step processes: 1) send the headers, 2) send the data.
Therefore, for websites with high volume traffic, it’s definitely preferable to choose GET method for AJAX requests over HTTP, because all it takes for GET to get out is a URL request, which is basically a TCP packet if you don’t have a lot of cookies.
However, as there is a limit on the length of the URL in Internet Explorer which is approximately 2k, so technically you can’t send a GET request with data more than that.
Another approach is to determine whether to use GET or POST is that, according to HTTP specification, GET is for fetching data while POST is for supplying. In this sense, use GET for data retrieval tasks and POST for data input tasks.
Related Posts
- PHP: How to distinguish values in $_POST or $_GET that are sent via HTTP requests and those that are set / assigned in the code
- Proprietary HTML comment tag in Internet Explorer of both Windows and Mac
- PHP: Subject String Length Limit of Regular Expression Matching Functions
- PHP cURL: Making POST Request to URL
- PHP and JavaScript Variable / Value Transfer / Exchange: How to pass variable values from PHP to JavaScript or JavaScript to PHP?
