GET and POST Action Types in MVC

Shivam Bhatele asked on April 14, 2020 10:52

Hello Everyone, I am confused about the difference between GET and POST action types? I am learning MVC related questions to crack my upcoming interviews. Can anyone know this, Please suggest.

Correct Answer

Dmitry Bastron answered on April 14, 2020 11:49

Hi Shivam,

By the sound of your question you may need quite a lot of reading to be honest. I can suggest you Adam Freeman's book Pro ASP.NET MVC 5 it explains a lot of aspects in details including different HTTP request types. Also, you could read more about different HTTP methods on w3school resource. Hope it helps.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Rohan Joshi answered on April 15, 2020 13:00

Here is the difference you should know:
1. HTTPGet method is default whereas you need to specify HTTPPost attribute if you are posting data using HTTPPost method.
2. HTTPGet method creates a query string of the name-value pair whereas HTTPPost method passes the name and value pairs in the body of the HTTP request.
3. HTTPGet request has limited length and mostly it is limited to 255 characters long whereas HTTPPost request has no maximum limit.
4. HTTPGet is comparatively faster than HTTPPost. HTTPPost takes extra time in encapsulating the data.
5. HTTPGet can carry only string data whereas HTTPPost can carry both string and binary data.
6. HTTPGet method creates readable url so it can be cached and bookmarked whereas such facility is not available in HTTPPost method.

For More Detailed information you can visit here.

1 votesVote for this answer Mark as a Correct answer

Rajesh Masiwal answered on May 24, 2020 20:58

Both GET and POST method is used to transfer data from client to server in HTTP protocol but the Main difference between the POST and GET method is that GET carries request parameter appended in URL string while POST carries request parameter in message body which makes it more secure way of transferring data from client to server in HTTP protocol.

To know more detailed information visit this post.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.