📜  asp net route 属性与 httpget - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:20.956000             🧑  作者: Mango

代码示例1
Route is method unspecific, whereas HttpGet obviously implies that only GET requests will be accepted. Generally, you want to use the specific attributes: HttpGet, HttpPost, etc. Route should be used mostly on controllers to specify the base path for all actions in that controller. The one exception is if you're creating routes for exception handling / status code pages. Then, you should use Route on those actions, since requests via multiple methods could potentially be routed there.