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

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.

主站蜘蛛池模板: 同江市| 平定县| 静安区| 郸城县| 芮城县| 潍坊市| 安义县| 铜川市| 铜梁县| 东乌珠穆沁旗| 天镇县| 西吉县| 新建县| 临湘市| 称多县| 武宣县| 射洪县| 波密县| 静安区| 湄潭县| 老河口市| 醴陵市| 广东省| 五华县| 会宁县| 晋江市| 历史| 永顺县| 类乌齐县| 新密市| 崇左市| 修水县| 琼结县| 淮南市| 清流县| 和顺县| 榆社县| 喜德县| 淮滨县| 阳高县| 南澳县|