The httprequest object contains all the information contained in the HTTP data package that passes in the Web request. The content of the HTTP header, query string, input field of the form, path, and URL information is organized in different sets and other special objects, which can be easily accessed by programming. When ASP. NET starts to process Web requests, the httprequest object will be filled and exposed through the request attribute of httpcontext.
Httprequest class attributes
Httprequest attributes can be divided into three types: Request type, client data, and connection.
Request Information
The following table lists the attributes of the request information:
The httpbrowsercapabilities object contains a large amount of information about browser functions, including whether ActiveX controls, scripting languages, frameworks, and cookies are supported. When the request arrives, an httpbrowsercapabilities class instance is created using the user agent information to determine the browser that sends the request, and the browser-specific information is filled in. This information is not dynamically set by the browser, but obtained offline from the server repository.
Information from the client
The following table lists the properties of the httprequest client data:
The Params set combines four different but similar forms: querystring, form, servervariables, and cookies, which are consistent with the data contained in the independent set. This set is filled in the following order: querystring, form, cookies, and servervariables.
Connection information
The following table lists the attributes related to opening a connection:
The URI class provides an object representation of a uniform resource identifier.
Httprequest Class Method
The following table lists the main methods of the httprequest class:
Save the request to disk
The saveas method allows us to create a file that stores all the content of an HTTP request. Note: The storage media can only be disk files, but cannot use streams and writers. Because ASP. by default.. Net account to grant full access to new files (or folders), is one of the conditions for the successful operation of saveas.