I\'m building an API for a Twitter like site using Web API and have trouble with mapping the routes
I have the following actions for the User controller:
<
There are a variety of useful reference materials on this subject, such as:
Have you had a look at these?
Update..
Its better practise to explicitly state which parameter is which, ie:
config.Routes.MapHttpRoute(
name: "2",
routeTemplate: "api/{controller}/{id}",
defaults: new { action = "Get", id = RouteParameter.Optional },
);
config.Routes.MapHttpRoute(
name: "1",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: null
);
Main thing I could see wrong was you had action / id in the wrong order in route "1".