ASP.NET Web API media mapping extensions and help pages -


i've done media type mapping in api can specify format want data in: ie host/api/values.json or host/api/values.xml. have following routes can specify extension on controller or controller/id:

        config.routes.maphttproute(             name: "defaultapi",             routetemplate: "api/{controller}.{ext}",             defaults: new { id = routeparameter.optional }         );          config.routes.maphttproute(             name: "api2",             routetemplate: "api/{controller}/{id}.{ext}",             defaults: new { id = routeparameter.optional }         ); 

the pages generated default ones come new vs 2015 webapi/mvc app template it's autogenerated. when generates shows following examples:

get api/values.{ext}      api/values/.{ext}   <------- notice 1  api/values/{id}.{ext} 

the first , last 1 work , make sense. it's generating middle 1 doesn't make sense , doesn't work when type in browser. since auto generated i'm trying figure out why it's giving me middle example when doesn't work (and if did doesn't make lot of sense).


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -