Difference between HTTP GET and POST

GET Method 
  • GET means that the form data is to be encoded (by a browser) into a URL and this is the default HTTP method
  • GET is less secure compared to POST, because data sent is part of the URL and Easier to hack
  • URL length is restricted in GET method
  • Can be bookmarked and cached
  • GET requests are re-executed, on back button or re-submit behavior
  • GET requests are idempotent (unchanged). It can be executed more than once without any side effects.
  • Example:
    • http://www.test.com/hello?key1=value1&key2=value2

·         POST Method

  • POST means that the form data is to appear within the message body of the HTTP request
  • POST is secure as compared to GET and difficult to hack
  • No restriction on length
  • Cannot be bookmarked and cached
  • The browser usually alerts the user that data will need to be re-submitted, on back button or re-submit behavior
  • POST requests are non-idempotent. So you have to be very careful while using POST functionality.

1 comment: