You might want to know what the difference between get and post is and want to know when to use them. Theoretically, if the request is idempotent, get can be used, and the so-called idempotent means that multiple requests return the same result. In fact, the corresponding server method may modify the state in some way, so this is generally not true. This is just a standard. The more practical difference is in the size of the net charge, and in many cases the browser and the server restrict the URL's length URL to send data to the server. In general, you can use get to fetch data from the server, in other words, to avoid changing the state on the server by using getting calls.
Generally, you should use the Post method when changing the state on the server. Unlike get, you need to set the Content-type header for the Xml-httprequest object, as follows:
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
Unlike get, post does not limit the size of the net load sent to the server, and the POST request is not guaranteed to be idempotent.
Most of the requests you make may be get requests, but you can also use post if you want.
Back to "Ajax Basics Tutorial-Directory"