Two methods are available to an HTML form, and the choice between them is not a matter of taste. Each has a defined meaning, and using the wrong one produces behaviour that ranges from mildly annoying to a genuine security problem.
How GET sends data
A GET request appends the form data to the address as a query string. The submitted values are visible in the address bar.
/search/?q=flexbox&category=css Everything after the question mark is the form data, with each pair separated by an ampersand. This is why a search results page has a shareable address that reproduces the same results.
How POST sends data
A POST request sends the data in the body of the request rather than in the address. It does not appear in the address bar, it is not stored in browser history, and it is not written to server logs in the way a query string usually is.
Note that hidden is not the same as secure. The data is still transmitted in plain text unless the connection is encrypted, so an encrypted connection is what protects it rather than the method.
The real distinction
The specification frames it as safe versus unsafe. A GET request should only retrieve data and should have no side effects, which means repeating it changes nothing. A POST request is for anything that changes state on the server.
This distinction matters because a great deal of software assumes it. Browsers pre-fetch links, crawlers follow addresses, security tools scan them, and everything in that chain treats a GET as harmless. An action that deletes something behind a GET request will eventually be triggered by a crawler that was simply doing its job, and this has happened to real sites more than once.
When to use GET
Use it for search forms, filters, sorting controls and pagination. Anything where the result is a view of data rather than a change to it.
The advantages are real. The address is shareable and bookmarkable, the back button works predictably, the result can be cached, and a user can adjust a parameter directly. A search that cannot be linked to is noticeably less useful, and the method is what makes that possible.
When to use POST
Use it for anything that creates, modifies or deletes. Registration, login, checkout, posting a comment, updating a profile, uploading a file.
Use it also whenever the data is sensitive, regardless of side effects. A password in a query string ends up in browser history, in the referrer header sent to any external resource on the next page, and in server logs where it will sit indefinitely. That is true even though the connection itself is encrypted, because the address is handled in plain form at both ends.
Use it for large amounts of data as well. Addresses have practical length limits which vary between browsers and servers, and exceeding them truncates data silently or produces an error.
The resubmission problem
Because a POST changes something, reloading a page that resulted from one prompts the browser to ask whether to resubmit. Users who press reload out of habit can duplicate an order or a comment.
The standard fix is a redirect after a successful POST, sending the browser to a confirmation page with a GET request. The address in the bar is then a safe one, reloading it is harmless, and the back button behaves sensibly. This pattern is worth applying to every form that changes data.
File uploads are always POST
There is no mechanism for sending a file with a GET request. A file input requires POST with multipart encoding, and getting either wrong means the server receives a filename rather than a file.
The other methods
HTTP defines several further methods, and HTML forms support only these two. Working with an interface that expects a different one means either sending the request from JavaScript or including a hidden field that tells the server to treat the POST as something else, which is a convention many frameworks implement.
A quick test
Ask whether it would be acceptable for this request to be repeated automatically several times without anyone intending it. If the answer is yes, GET is appropriate. If the thought is alarming, it needs to be a POST.