I have ApiController called Users And on default I have Post in there. It works fine.
However, I decided to add an additional action that also works on Post method, and now I have the following code:
[HttpPost]
public HttpResponseMessage Post(dynamic data){}
[HttpPost]
public HttpRequestMessage LogOff([FromBody]dynamic data){}
I also modified Routing, trying every commented here option: //config.Routes.MapHttpRoute( // name: "UserApi", // routeTemplate: "api/Users/LogOff/{data}/{id}", // defaults: new { id = RouteParameter.Optional } //);
//config.Routes.MapHttpRoute(
// name: "userapi",
// routeTemplate: "api/{controller}/{action}"
//);
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
I also played with switching their order position and no result, it always says : web api Multiple actions were found that match....