Not all actions aremeantto return HTML (such as views). Some return content is only suitable for non-human processing, such as some client APIs. In this case, other content is more suitable than HTML—namely, apresentationlanguage, such as JSON or XML. Sometimes, it is only necessary to return an HTTP status code or some response headers. In the past, this was done with APIs outside the ASP.NET MVC, suchaswith Microsoft'sASP.NET Web API(https://www.asp.net/web-api),Nancy(http://nancyfx.org), orServiceStack(https://servicestack.net).
Let's look at the ASP.NET web API. It shared quite a few concepts and similarly named (and purposed) APIs with MVC, but it was an entirely different project that used different assemblies and a different bootstrap mechanism such as Open Web Interface for .NET (OWIN). Unsurprisingly, Microsoft made the decision with ASP.NET Core to unify the MVC and web API; now, there is no more web API, just the...