What is the difference between HTTP method Get and Post?

 Posted by deccansoft on 10/30/2010 | Category: ASP.NET Interview questions | Views: 6922


GET Method:

1.All the name value pairs are submitted as a query string.
2.It’s not secured as submitted text is visible in plain text format in the Location bar of the web browser.
3.Length of the submitted string is restricted.
4.If get method is used and if the page is refreshed it would not prompt before the request is submitted again.

POST Method:

1.All the name value pair’s are submitted in the Message Body of the request structure.
2.Length of the string (amount of data submitted) is not restricted or limited.
3.Post Method is secured because Name-Value pairs cannot be seen in location bar of the web browser.
4.If post method is used and if the page is refreshed it would prompt before the request is submitted again.

As a general thumb rule if the form submitted changes the state or data on server then the request method used can be post otherwise if the data submitted doesn’t affect the server then the request method used can be post.

When we submit a search string to search string then the request method can be "get" because the submission will not change the state of server.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response