Does anyone know exactly when to use the GET and when to use the POST methods, why and why not? Thanks in advance.
That's right. POST method doesn't show any URL and is more suitable for secure transactions. I recently came across this 'idempotent' stuff. They say it is advisable to use the GET method for idempotent transactions and the POST method, if otherwise. And the benefit?? Am I right if I say that the only benefit is that the browser-makers can design more consistent warnings? Or are there any other 'real' benefits?
I use POST for almost everything. But remember if you don't do a header redirect after the POST it will ask them to resend the data when they refresh. And there is a limit on the amount of characters allowed in the GET method.
I use GET for most of simple data query, for example like this: article.php?id=1 or article.php?category=whatever POST is most likely to be used whenever you want to submit something like login/registration form.
I use POST for almost everything. But remember if you don't do a header redirect after the POST it will ask them to resend the data when they refresh. And there is a limit on the amount of characters allowed in the GET method. Which is like 100,000 in most browsers. Regardless of what the W3schools site saying its about 100.