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

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.

主站蜘蛛池模板: 大化| 菏泽市| 应城市| 岳阳县| 根河市| 兰西县| 桃江县| 望江县| 英吉沙县| 朝阳县| 马龙县| 和政县| 太康县| 两当县| 淮南市| 桑植县| 监利县| 山阳县| 双江| 二手房| 铜鼓县| 蒙山县| 师宗县| 隆子县| 昌邑市| 会昌县| 闽侯县| 鹤壁市| 苍山县| 青川县| 永顺县| 驻马店市| 无锡市| 洪洞县| 神木县| 会同县| 陈巴尔虎旗| 卢湾区| 翁源县| 陵川县| 汉阴县|