Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 1
    With MVC2 and up one can also use the HttpPost/HttpGet attribute Commented Dec 13, 2012 at 17:22
  • @yohal Yes, that would be the canonical way to handle it now if you don't need to support multiple verbs. Commented Dec 13, 2012 at 20:10
  • 3
    Just beware not to abuse this to violate the principles of REST. Commented Apr 25, 2016 at 13:21
  • 1
    Pretty sure this is only working because your Show() methods have different signatures. If and when you need to send info into the Get version, your Get and Post versions then end up with the same signature, and you'd have need of the ActionName attribute or one of the other fixes mentioned in this post. Commented Dec 15, 2016 at 23:35
  • 1
    @ScottK.Fraley that's true. If they needed the same signature you'd have to name them differently and apply the ActionNameAttribute. In practice, I've rarely found that to be the case. Commented Dec 15, 2016 at 23:40