I am hitting the controller the controller with the following url :
"http://localhost/api/controller/1/2"
In the controller I have the following methods:
[HttpPost]
public void PostMethod2(string a,string b)
[HttpPost]
public void PostMethod()
The controller is actually hitting the PostMethod() but I dont know how to read the parameter values 1 and 2.
Is there any other better way of calling it?
You can add your custom route for this method in Global.asax.cs
Or if you’re using ASP.NET MVC Web Api you can hook your route in RouteConfig.cs in App_Start folder like so: