Browsers typically embed two modules:
Socket communication module → The browser places the data of the address bar and other data into the request header file of the HTTP protocol, and the socket sends this HTTP request data to the remote server side
Browser engine rendering module → The browser accepts HTTP response header data returned from the server and renders the data requested by the user into an interface that the user sees
Asp. NET developers and httpapplication,httpcontext,httprequest,httpresponse these four classes should be old acquaintances, and the ASP. NET event pipeline is also familiar to the ASP, as far as I am concerned, I have been a bit ignorant of these, although many documents are still found. In fact, these classes are the classes created after the ASP. NET Server accepts the browser's request, and the ASP. NET Server processes and responds to browser requests in this four class (mainly these four classes).
The HttpRuntime class is the gateway for ASP. The above four classes are created based on this class, and the HttpRuntime class creates these four classes to help it handle browser requests. Below is a brief summary of these four classes:
The HttpRequest class, which is a number of properties that represent the parameters of an HTTP request.
The HttpResponse class, which provides methods and properties for responding to clients.
The HttpContext class, which encapsulates objects of the HttpRequest class and the HttpResponse class, is designed to simplify server-side processing of HTTP parameters.
The HttpApplication class is the play, and this class is used to handle requests, and what we call the processing pipeline is created here. Because in the process of actual processing requests, we need to do a lot of work. If we do these tasks in one way, it is obvious that the method is bloated. In the HttpApplication, use. NET's event mechanism, which is the processing pipeline, by decomposing these processes into multiple steps through multiple events emitted during processing.
In the event pipeline's ProcessRequest event, the passed in parameter is an instance of the HttpContext class, because in this method we are processing the HTTP request in detail, and we need to get detailed information to pass in the HttpContext class instance.
The global rough run process is as follows:
This data and figure is from the Dark Horse programmer. NET Video and ASP. NET essence theory
Asp. NET platform and what happens after you enter it from the browser's address bar