HTTP request processing under ASP.

Source: Internet
Author: User

ASP. NET core is a self-hosted program that contains the programs class. The Buildwebhost method is the first way the program starts executing. Similar to main function body

 Public Static Iwebhost buildwebhost (string[] args) =            webhost.createdefaultbuilder (args)                . Usestartup<Startup>()                . Build ();

The Iwebhost is built through Iwebhostbuilder. Then use usestartup to enter the program startup phase. Then came There are two methods in the StartUp.cs class file. IConfiguration and configure

IConfiguration first execution, the main purpose of this method is to inject the object through Iserviceconllection, the Configura method is the main function of processing middleware.

Middleware middleware It is called by Iapplicationbuilder, which is called by App.run App.use App.map, which is three ways to use.

The middleware carries the Requestdelegate delegate, which contains the HttpContext parameter. Therefore, the middleware can operate on the request, such as changing the routing operation, after the route resolved to the corresponding page after processing, carry response back to the client.

There is not a picture to find. A very graphic description of the HTTP request pipeline for Asp.netcore. Personally think the image will make people remember deeply. I'll fill it up when I find it. I think these are just plain to understand the surface of the things, deep-rooted things also need to dig their own source AH ~

HTTP request processing under ASP.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.