Is it possible to host MVC and Web API controllers using the same routes but serving different content?
What I would like is for the correct controller to be selected based on the content type in the Accept header of the request.
For example:
GET /users/1 [Accept: text/html]
would invoke an MVC Response.
GET /users/1 [Accept: application/json]
would invoke a Web API response.
I realise that it is possible to render Razor views and return HTML directly from Web API, but then I wouldn't be able to use the MVC goodness for rendering my main site (unless someone tells me that you can do everything in Web API that MVC can do!)
related (but not the same) question: ASP.NET MVC 4 ApiController and Normal Controller Routes