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

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.

主站蜘蛛池模板: 边坝县| 荣成市| 安达市| 新和县| 措美县| 南充市| 拜城县| 桂东县| 赫章县| 博兴县| 五常市| 曲周县| 广饶县| 忻城县| 临安市| 屏南县| 定襄县| 读书| 桃园市| 金川县| 黎城县| 平塘县| 邳州市| 醴陵市| 朔州市| 秀山| 昭平县| 鄱阳县| 柳江县| 思南县| 林西县| 宕昌县| 特克斯县| 远安县| 万全县| 土默特左旗| 三河市| 岢岚县| 阿荣旗| 太仆寺旗| 绥滨县|