Created
May 7, 2015 18:31
-
-
Save coreypnorris/d0facd8b5a21caf04376 to your computer and use it in GitHub Desktop.
Restricting access to controller actions to certain kinds of http requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace OdeToFood.Controllers | |
| { | |
| public class CuisineController : Controller | |
| { | |
| [HttpGet] | |
| public ActionResult Search(string name) | |
| { | |
| var message = Server.HtmlEncode(name); | |
| return Content(message); | |
| } | |
| [HttpPost] | |
| public ActionResult Search() | |
| { | |
| return Content("Search!"); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment