Applying Web API concepts and best practices
ASP.NET Core 2.0 combines the best features of ASP.NET MVC and Web APIs together into a single framework. This makes complete sense, since they provide many similar functionalities.
Before this merger, developers had to rewrite code when they needed to expose data in different formats via MVC and Web APIs. They had to work with multiple frameworks and concepts at the same time. Fortunately, this entire process has been completely streamlined in ASP.NET Core 2.0, as you will see during this chapter.
The following diagram illustrates how client HTTP requests are handled by ASP.NET Core 2.0 concerning Web APIs and MVC:
Web APIs normally use either JSON or XML as a response format. JSON would be the preferred format, since it has become quasi-standard on the market and everybody is using it due to its simplicity and efficiency.
Furthermore, filters and middlewares can be used with Web APIs, since ASP.NET Core 2.0 manages Web APIs the same way it does...