You already know how each one works, so I’ll give examples of when to use.
GET passes variables by URL, it is useful for you to share a product page, make pagination, such things... That is, as a benefit you can reproduce a search just by copying the URL, since the variables are in it.
Example:
product.php? product=200 (will display product with id 200)
You could even save the URL as favorite, would go to the product 200.
With POST you can not do these things I said above, because the data is sent in the body of the HTTP request, as you said, is ideal for login forms, registration, sending files (by get do not give).
In short: the difference is mainly in data visibility.
Note: the GET request is relatively faster, since it is simpler. In the POST request there is a waste of time in the message encapsulation.
Related : http://answall.com/questions/16821/por-que-os-browsers-n%C3%A3o-implement-os-protocols-put-e-delete-do-http
– Guilherme Lautert
It’s unrelated, but I appreciate the try
– João Victor Gomes Moreira
Maybe it’s a duplicate of: What are the advantages of using the right HTTP methods?
– rray
What are the HTTP request methods, and what is the difference between them?
– Bacco
@rray if someone who doesn’t have a gold medal votes for one, and one of us votes for the other, they’re both like duplicates. I think by joining your link with what I’ve gone through, it’s complete. There’s only one left without a gold medal "pull the queue".
– Bacco
@Bacco cool this other question, the two as reference gets 100%.
– rray
And who wants to complete the reasoning, can post answer them, fits more there, then everything is linked.
– Bacco