> http://developer.yahoo.com/ says: when using XMLHttpRequest, POST is implemented in the browsers as a two-step process: sending the headers first, then sending data. So it's best to use GET, which only takes one TCP packet to send (unless you have a lot of cookies). The maximum URL length in IE is 2K, so if you send more than 2K data you might not be able to use GET.
Is it me, or is this "best practice" is really wrong ?
The statement that a POST request is sent in two packets is wrong. Thanks to TCP's Nagle algorithm, most POST requests are be sent in a single packet (at least POST requests that are small enough to be candidates for being sent as GET requests), even if the browser sends the data in two write() calls
Secondly, if you modify the server's state in a GET request you are violating the HTTP protocol. Since GET should not modify the server's state, the browser is allowed to e.g. pre-fetch the URL, or re-fetch it when the browser is re-opened, which may be unexpected by the developper (it could send a blog post comment twice, or worse, execute a payment twice).