官术网_书友最值得收藏!

Overview — REST APIs with ASP.NET Core API

In Chapter 3Creating a Web Server with ASP.NET Core, you saw how to create a basic ASP.NET Core MVC application that can be broken down into three layers: models, controllers, and views. RESTful APIs in ASP.NET Core work very similarly; the only difference is that, instead of returning responses as visual views, the API response is a payload of data (usually in JSON format). The data returned from the API is later consumed by clients, such as Angular-based applications that can render the data as views, or by headless clients that have no UI and simply process data. (More information on headless clients can be found at https://en.wikipedia.org/wiki/Headless_software.) For example, consider a background process that periodically sends notifications to a user about their account status:

Before ASP.NET Core, Microsoft created an explicit distinction between ASP.NET MVC and the ASP.NET Web API. The former was used to create web applications with views that are generated by the server, while the former was used to create services that contain only logic and can be consumed by any client. Over time, the distinction between the two frameworks caused duplication of code and added a burden on the developers who needed to learn and master two technologies. ASP.NET Core unified the two frameworks into the ASP.NET Core MVC suite, and made it simpler to create web applications, with or without visual responses.

Let's start with a simple API that will be the foundation for our GiveNTake application.

主站蜘蛛池模板: 吴堡县| 蓝田县| 磐石市| 上栗县| 吉水县| 同仁县| 永清县| 上虞市| 灵川县| 古浪县| 哈密市| 江达县| 长宁县| 陆丰市| 大港区| 瑞丽市| 宁南县| 上高县| 通州区| 咸宁市| 岚皋县| 疏附县| 南和县| 博兴县| 海南省| 西乌| 宁武县| 砚山县| 米泉市| 恩平市| 台前县| 武夷山市| 固镇县| 宁蒗| 邛崃市| 苏尼特左旗| 淳化县| 清新县| 河池市| 新宁县| 洛隆县|