lundi 20 février 2017

Web API url without action

I have web api config like in example and url action, and my current url is ../api/home/index/variable=1, but i want get url like this: ../api/home/variable=1 . So without action. How do it? Please, help!

config.Routes.MapHttpRoute(
                  name: "DefaultApi",
                  routeTemplate: "api/{controller}/{ID}", new { controller = "Home", action="Index" id = RouteParameter.Optional });
                );

Url.Action("Index", "Home", new { [id or something else, i forgot ]})




Aucun commentaire:

Enregistrer un commentaire