asp.net - WebApi routing not passing value -
i trying pass value controller / action in web api it's not finding it.
my route mapping:
config.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}/{action}/{id}", defaults: new { id = routeparameter.optional } );
my apicontroller:
[httpget] public string mything() { return "thing"; } [httpget] public string mystuff(int myid) { return "something " + myid; }
my rest call via restsharp:
var request = new restrequest { resource = "api/values/mystuff/555", method = method.get };
if call mything()
works though. seems problem in passing id value.
modify parameter name "myid" "id"
[httpget] public string mystuff(int **id**)
Comments
Post a Comment