What is HTTP GET and HTTP POST in MVC?
What is HTTP GET in MVC?
HTTPGet method helps to create a query string of the name-value pair whereas the HTTPPost method passes the name and value pairs in the body of the HTTP request. It has a limited length and mostly it is limited to 255 characters long whereas HTTPPost request has no maximum limit.
Features of HttpGet:
1. It is a fast and quick method but not secure.
2. HttpGet is the default method.
3. It uses the stack method for passing form variables.
4. Data is limited to a max length of the query string.
5. It is very useful when data is not sensitive.
6. HttpGet creates a URL that is easily readable.
7. It can carry only text data.
What is HTTP POST in MVC?
HTTPPost method helps to hide the information from the URL and does not bind data to the URL. It is more secure than HttpGet method but it is slower than HttpGet. HTTPPost is very useful when you are passing sensitive information to the server.
Features of HttpPost:
1. HttpPost is more secure but slower than HttpGet.
2. Data is sent via the HttpPost method and isn’t visible to the user.
3. It uses the Heap method for passing form variables.
4. It has no restriction on passing data and can post unlimited form variables.
5. HttpPost is used when sending critical data.
6. It can carry both text and binary data.