What is the difference between the GET and POST methods (in forms)?

  • With the GET method the form data gets tracked right onto the URL sent to the server:
  • get http://url.of.the.processing.script/file?name1=variable1&name2=variable2

    The GET method is used when we want to obtain information from the server (such as search results), and it shouldn't be used to alter or store information in the server (because if the user goes back on the web browser, it's submitted again). The data from the form will be shown in the address bar of the web browser. The GET method has a character limit.

  • With the POST method the browser sends a separate server request containing some special headers followed by the data. In theory, only the server sees the data, so is much more secure than the GET method. If the server has HTTPS enabled, the data will be encrypted, so no one can access to it during transit. The POST method is recommended when data alterations are needed on the server, such as storing an email address on a database. The POST method has not a character limit (useful for sending big chunks of data).