asp.net - Defining a WebAPI route without the /api/{controller} prefix -
I want to request in the format without the prefix / api / {controller} (like www.myapp.com /download/image1.jpg ) by a WebAPI controller method. Is it possible or do I need to switch to the MVC controller? I have set the following route: But unfortunately this does not work, the controller is not even created (I have a mark in the constructor) Try attribute routing (only available in Web API2)
config.routes.MapHttpRoute (name: "check", path: "download", default: new {controller = "download", action = "check in "});
Comments
Post a Comment