---
title: "When to use HttpGet and HttpPost method with ActionResult method in ASP.Net MVC?"  
description: "When to use HttpGet and HttpPost method with ActionResult method in ASP.Net MVC?"  
author: "Steilla Mitchel"  
published: 2022-03-15  
updated: 2022-03-15  
canonical: https://www.mindstick.com/forum/156917/when-to-use-httpget-and-httppost-method-with-actionresult-method-in-asp-dot-net-mvc  
category: "asp.net mvc"  
tags: ["asp.net", "asp.net mvc"]  
reading_time: 2 minutes  

---

# When to use HttpGet and HttpPost method with ActionResult method in ASP.Net MVC?

When to use [HttpGet and HttpPost](https://www.mindstick.com/forum/157893/what-is-the-difference-between-the-httpget-and-httppost-attributes-in-asp-dot-net-mvc) method with [ActionResult](https://www.mindstick.com/forum/33961/what-is-the-difference-between-actionresult-and-viewresult) [method in ASP.Net](https://www.mindstick.com/forum/12764/can-t-pass-formcollection-to-create-method-in-asp-dot-net-mvc) [MVC](https://www.mindstick.com/forum/155803/define-cache-profile-in-mvc)?

## Replies

### Reply by Ana ka

HttpGet and HttpPost are both the methods of posting client data or form data to the server. HTTP is a HyperText Transfer Protocol that is designed to send and receive the data between client and server using web pages.

### Reply by Kalin

## HttpGet in [ASP.Net MVC](https://www.mindstick.com/forum/155798/what-is-caching-in-asp-dot-net-mvc):

HttpGet [method](https://www.mindstick.com/forum/166/webservice-method) send data to the server using query string. The data which send is visible to URL and it can visible for all the users. It is not secure than HttpPost but it is fast and quick than that. Generally this is used when you are not posting sensitive data to the server like user’s name and password or other personal important information.

By default HttpGet is used with ActionResult method in controller page in asp.net mvc.

## Features :

**1-** It is fast and quick response.

**2-** It is default method in asp.net mvc.

**3-** URLs that are created using it, easily readable.

**4-** Its used suitable when not posting any sensitive data to the server.

Exp- HttpGet is used with ActionResult() in controller like below-

```
[HttpGet]
public ActionResult Login() {
    return View();
}
```

## HttpPost in ASP.Net MVC:

HttpPost methods hides user’s information from URL when post data to the server and does not bind data to URL. It is secure than HttpGet method but it is slower than that. When sending any sensitive data to the server then it is used.

## Features:

**1-** It is slower than HttpGet method.

**2-** It is used when sensitive data post on server.

**3-** It is hide information from the URL.

**4-** It carry both binary and text data.

**5-** It is more secure than HttpGet method.

## Exp-

```
[HttpPost]
public ActionResult Login(string userName, string password) {
    // do login stuff
    return View();
}
```

\


---

Original Source: https://www.mindstick.com/forum/156917/when-to-use-httpget-and-httppost-method-with-actionresult-method-in-asp-dot-net-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
