Is HTML a valid media-type for building web sites with RESTful API ?
This is the question I’ve been asking myself while confronted to a problem of building a web site and RESTful API at the same time. I’ve been told that I can’t build one and have both. Why ? HTML is just another media-type but what is generally used when building web sites is the capacity of templated view generation which is much more then simple HTML resource representation. And yes, I know, the ambiguity is even more emphasized when we try to chose a right framework for the task at hand. In short, the guideline is; if you want HTML based web site then use ASP.NET MVC and for JSON/XML support use rather ASP.NET Web API or another framework like Nancy (I’m speaking here for the .NET world). Well, I don’t want make my choice based on that criteria. Let’s go deeper to see what options we have.