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

Generating a response of different types

So far, all the of action methods we have created returned simple response types, such as string or arrays, but the HTTP standard has no concept of method signature and return type. Instead, it defines the format of a valid HTTP response. This is how a simple HTTP response might look:

As you can see, the HTTP response includes Status Code, Headers, and Body. Each of these parts allows you to communicate pieces of information to the client, and ASP.NET Core provides the glue that converts the results of your action methods into those parts of the HTTP response, regardless of whether they are executed successfully, or completed with a failure.

主站蜘蛛池模板: 安乡县| 锡林浩特市| 襄汾县| 抚州市| 丹江口市| 金乡县| 罗江县| 信丰县| 栾川县| 甘南县| 平遥县| 万源市| 三门峡市| 五家渠市| 巴中市| 十堰市| 二连浩特市| 汾西县| 宜兰县| 湘潭县| 沙河市| 盐源县| 高密市| 通渭县| 南昌县| 区。| 含山县| 云龙县| 达拉特旗| 宜良县| 南通市| 堆龙德庆县| 安溪县| 泽库县| 台北市| 江阴市| 高淳县| 乌拉特中旗| 广宁县| 林芝县| 礼泉县|