Answers for "asp net route attribute vs httpget"

C#
0

asp net route attribute vs httpget

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.
Posted by: Guest on April-13-2021

C# Answers by Framework

Browse Popular Code Answers by Language