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

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.

主站蜘蛛池模板: 蚌埠市| 南川市| 舟山市| 绵阳市| 吴堡县| 朝阳区| 湖州市| 长汀县| 阜宁县| 调兵山市| 淮滨县| 洞口县| 京山县| 宜宾县| 桂阳县| 义马市| 石景山区| 信丰县| 哈尔滨市| 泉州市| 扎鲁特旗| 奈曼旗| 临洮县| 犍为县| 无为县| 磴口县| 遂宁市| 巴林左旗| 宣威市| 陈巴尔虎旗| 平顺县| 乐陵市| 海伦市| 双桥区| 新巴尔虎右旗| 井研县| 甘孜| 莲花县| 华池县| 永吉县| 茌平县|