Anatomy of a web API
Now that we have explored the basics of ASP.NET MVC in Chapter 4, The MVC Pattern using Razor, and a way to render web pages, it is time to jump into web APIs and return data instead of a user interface. In the past few years, the number of web APIs just exploded from a few to a gazillion of them; everybody does that nowadays. In this case, I don't think that's because people are blindly following a trend, but based on good reasons that make web APIs so appealing, such as the following:
- It is an efficient way of sharing data between systems.
- It allows interoperability between technologies by dialoguing in universal languages, such as JSON or XML.
- It allows your backend to be centralized and shared with multiple frontends such as mobile, desktop, and web applications.
Those reasons make it easier to reuse backend systems and share them with multiple user interfaces or other backend systems. For example, think of any mobile app that...