What are the differences between GET and POST methods in form submitting?

GET and POST are two different methods that can be used to submit form data to a web server. Each has their own set of advantages and disadvantages.

<form method="GET">

Specifying the value of GET means that the browser will add the form contents to the end of the URL. This allows the browser to cache the results of the form submission, as well as allows the user to bookmark the page once the form has been submitted. However, it also allows the entire contents of the submission to be visible in the URL. This is why GET is primarily used for short forms that do not contain sensitive information. GET can also be only used to send ASCII data and only about 3000 characters.

<form method="POST">

Specifying the value of POST means that the browser will send the data to the web server to be processed. It allows one to add data to a database. It is primarily useful to submit sensitive information, such as passwords. It also does not allow one to bookmark the results of a form submission. However, if the form is submitted twice, it will result in a duplicated entry which can be problematic in some scenarios.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.