The answer is here:
GET Method:
- All the name value pairs are submitted as a query string in URL.
- It's not secured as it is visible in plain text format in the Lacation bar of the web browser.
- As the data transfers through address bar (URL) there are some restrictions in using space, some characters like ampersand (&) etc in the GET method of posting data. We have to take special care for encoding data if such special characters are present.
- Length of the string is restricted.
- If method is not mentioned in the Form tag, this is the default method used.
- If get method is used and if the page is refreshed it would not prompt before the request is submitted again.
- One can store the name value pairs as bookmark and directly be used while sharing with others - example search results.
- Data is always submitted in the form of text
- If the response of the page is always same for the posted query then use GET example database searches
POST Method:
- All the name value pairs are submitted in the Message Body of the request.
- Length of the string (amount of data submitted) is not restricted.
- Post Method is secured because Name-Value pairs cannot be seen in location bar of the web browser.
- If post method is used and if the page is refreshed it would prompt before the request is resubmitted.
- If the service associated with the processing of a form has side effects (for example, modification of a database or subscription to a service), the method should be POST.
- Data is submitted in the form as specified in enctype attribute of form tag and thus files can be used in FileUpload input box.
Read more: http://wiki.answers.com/Q/What_is_the_difference_between_get_and_post_method_in_HTTP
No comments:
Post a Comment