GET vs POST method in PHP

Two commonly used methods for a request-response between a client and server are: GET and POST. But it has some differences, and that is given below.

GET Method :

  • Get request can be cached in browser.
  • Get request remain it’s history in the browser.
  • Get request can be bookmarked in browser.
  • get request shows the parameter in browser.
  • Get request should not be used when working with sensitive data.
  • Get request has restriction in data length.
  • Get request id useful for retrieve the data
  • Get request only allowed ASCII character.
  • Get request is easier to hack for script kiddies

POST Method :

  • POST request never cached in browser.
  • POST request do not remain it’s history in the browser.
  • POST request cannot be bookmarked.
  • POST request do not shows parameter in browser.
  • POST request is used to dealing with sensitive data.
  • POST request has no restriction in data length.
  • POST request allowed all data type (also Binary data).
  • Very difficult to hack.

This is the most common difference between GET and POST method