I have been working on a Web API which I am hoping to be RESTful. To give an example:
http://product.domain.local/person
would give a a web page with a nice UI served by ASP.NET MVC (for humans).
However, if I ask for Accept json/xml in my HTTP header, I'd like to redirect the request to my Web API controller. ie. as well as MapHttpRoute, I want to map based on contentType requested.
Therefore, when my API returns an ID:
http://product.domain.local/person/1
If a human uses it, they get a web page, if a client application uses it, they get JSON/XML (because they'd modify the Accept header), which allows me to use HTTP redirection, etc. to work towards REST.
But I can't find a way to do this. Is it even possible?
apiprefix in the routes. But I suspect that this won't be an easy thing to implement.