The Request object actually operates the HttpRequest class in the System. Web namespace. When the customer sends a Request to execute the ASP. Net program, the CLR will encapsulate the client Request information in the Request object. These request information includes the request Header, basic client information (such as browser type, browser version number, user language)
And the encoding method), request methods (such as PosT and GET), parameter names, parameter values, and so on.
Some information contained in a request RequeM is as follows:
Connection: Keep-Alive Accept :*/*
Accept-Encodng: gzip deflate
AccePt-Language: 2h-cn
Cookie: A5PSessionId = 52qc 2i rpxyovuoexh k2x 2kqt
Host: Localhost
User 1 Agent: Mozilla 2 llla/4.0 (comPatible; NSIE 60b: Wlndows Nt 5.0 ;...)
The Request object is called as follows:
Request. Collectlon ["VariabLe"]
The Cotle canopy includes four types of collections: QueryString, ForM, Cookies, and SeverVaiables. The C0ollection can be omitted here. That is to say, both Request ["Variable"] and Request. Collection ["Variable"] are allowed. If Collection is omitted, the Request object will be searched in the order of QueryString, ForM, Cookies, and SeverVaiables until the keyword indicated by Variable is found and its value is returned. If no value is found, the return value is Null ).
To optimize the execution efficiency of the program, it is recommended that you use collection. If you search too much, the execution efficiency of the program will be reduced.