ASP. NET 3.5 core programming learning notes (31): httprequest object

Source: Internet
Author: User

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.

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.