Wednesday, October 17, 2012

What is difference between the GET and POST methods?

  1. In GET Method, All the name value pairs are submitted as a query string in URL. But in the POST method name value pairs are submitted in the Message Body of the request. 
  2. GET Method is not secured as it is visible in plain text format in the Location bar of the web browser. But POST Method is secured because Name-Value pairs cannot be seen in location bar of the web browser. 
  3. Also in GET method characters were restricted only to 256 characters. But in the case of POST method characters were not restricted. 
  4. About form default, Get is the defualt method for any form, if you need to use the post method, you have to change the value of the attribute "method" to be Post.  
  5. About the data type that can be send, with Get method you can only use text as it sent as a string appended with the URL, but with post is can text or binary. 
  6. If get method is used and if the page is refreshed it would not prompt before the request is submitted again. And if post method is used and if the page is refreshed it would prompt before the request is resubmitted. 
  7. GET method can be bookmarked. But POST method can not be bookmarked.
  8. In GET method data is always submitted in the form of text. In POST method data is submitted in the form as specified in enctype attribute of form tag and thus files can be used in FileUpload input box.
  9. GET method should not be used when sending passwords or other sensitive information. POST method used when sending passwords or other sensitive information.
  10. GET method can be cached. POST method can not cached.

No comments:

Post a Comment