Can not send parameter name "action" by url in asp.net web api 2.0.
Example:
if you do so:
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{action}",
defaults: new
{
action=RouteParameter.Optional
}
);
method in controller:
public HttpResponseMessage Get(int action)
{
return ResponseXml();
}
gives an error message:
in the dictionary path name of the parameter "action" is contained in the URL-address more than once
How to pass parameter name "action" as a parameter, rather than the action method ?
thanks