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:

  config.routes.MapHttpRoute (name: "check", path: "download", default: new {controller = "download", action = "check in "});   

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)

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -