---
title: "[HttpPost/HttpGet] for Action in MVC"  
description: "[HttpPost/HttpGet] for Action in MVC"  
author: "Sachin Singh"  
published: 2016-03-09  
updated: 2016-03-09  
canonical: https://www.mindstick.com/forum/34045/httppost-httpget-for-action-in-mvc  
category: "asp.net"  
tags: ["c#", "asp.net", "asp.net mvc", "http", "https", "http post", "http request"]  
reading_time: 1 minute  

---

# [HttpPost/HttpGet] for Action in MVC

Hi Everyone,\

i am using [MVC](https://www.mindstick.com/forum/155803/define-cache-profile-in-mvc) with C#. I want to know what is [practical](https://answers.mindstick.com/blog/54/minimal-apis-in-dot-net-a-practical-guide) use of [HttpPost/[HttpGet](https://www.mindstick.com/forum/156917/when-to-use-httpget-and-httppost-method-with-actionresult-method-in-asp-dot-net-mvc)] in MVC .

Can [anyone give me](https://answers.mindstick.com/qa/41194/can-anyone-give-me-some-high-and-low-points-of-each-of-the-four-first-presidential-administrations) example when we used ?

thank you.

\

## Replies

### Reply by Anupam Mishra

Hi Sachin,\

If you are working with MVC then one controller are given by MVC when we create a New Project i.e. Account Controller. In Account Controller, we have a Login action which provides the user with a login screen, then receives the user name and password back after the user submits the form:

\

![[HttpPost/HttpGet] for Action in MVC](https://www.mindstick.com/mindstickforums/0ddec58f-b880-4e3f-a57e-b082999588f4/images/f0fd67ac-e887-4c05-990d-efcd870bf531.png)\

\

We see in login action [**HttpGet**] is the first action and [**HttpPost**] and the second action, **MVC clearly knows which action is which. When a user views a page, that's a GET request when a user submits a form, that's usually a POST request** . **HttpGet** and **HttpPost** just restrict the action to the applicable request type.

We can also combine both request in an one action using below syntax:

[AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post)].


---

Original Source: https://www.mindstick.com/forum/34045/httppost-httpget-for-action-in-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
