![Hands-On Full:Stack Web Development with ASP.NET Core](https://wfqqreader-1252317822.image.myqcloud.com/cover/264/36699264/b_36699264.jpg)
上QQ阅读APP看书,第一时间看更新
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:
![](https://epubservercos.yuewen.com/BBCF69/19470386501528506/epubprivate/OEBPS/Images/da10d816-bf87-4a1f-af13-2daccd4b331d.png?sign=1738893977-fjN4qh0YKiixyGzDHvf89azVac4aU4aP-0-76239ba77c2104ab01bc59d7ed139676)
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.