You may want to know the differences between GET and POST and when to use them. Theoretically, if a request is idempotent, you can use GET. idempotence means that multiple requests return the same result. you may want to know the difference between GET and POST, and want to know when to use them
. Theoretically, if the request is idempotent, it can be used. GET The power equality means that multiple requests return the same result. In fact, the corresponding server method may modify the status in some way, so this is generally not true. This is just a standard.The actual difference is the size of the net load. in many cases, the browser and server limit the URL length to send data to the server. Generally, GET can be used to obtain data from the server. In other words, you must avoid using GET to change the status on the server.
Generally, the POST method should be used when the status on the server is changed. Unlike GET, you need to set the Content-Type header of the XML-HttpRequest object, as shown below:
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 cannot be idempotent.
Most of the requests you make may be GET requests. However, you can use POST if necessary.