I know the differences between HTTP get and post methods (as expalined in big details in this question).
My question is why not always use the post method for AJAX calls, which is safe. Is there get request faster? is there is reason to prefer get then post?
For none ajax call there is a reason – to share a link to the same url, but for AJAX this argument it’s not good…
GET requests are smaller and faster; and leverage caching, both on the client side and on the part of any proxies that may be in play.
For data that isn’t expected to change very often, GET requests are often very sensible, as they have a greater chance of not being resent unless necessary.
For data that is expected to change more often, however, POST is indeed the safer option, as it will always be resent to the server, making sure that changes are always respected.
There is also semantic issues that come into play. POST requests should really only be used when the intent is to modify data on the server.