I have created an API that looks for parameters as such ...
http://server/api/contollerName/param1/param2/param3
for this pattern I used the following method attribute:
[Route("api/myController/{param1}/{param2}/{param3}")]
[HttpGet]
public IHttpActionResult myMethod(int param1, int param2, int param3)
{
// Method implementation goes here
}
However the person who will be utilizing the API (the UI developer) would prefer to have the API setup as this ...
http://server/api/controllerName?param1=value¶m2=value¶m3=value
Am I correct in thinking that all I need to do is remove the attribute to my method and the Web Api routing engine will choose the correct method based on the parameter names? Is there a way I could modify the route to explicitly define the method and parameters like I have originally done? I like having the route specified so there is no ambiguity as to which method will be executed.