ASP. NET System Object Request (i)

Source: Internet
Author: User

Request Object

   used to get all the information the client is providing when requesting a page or sending a form . It includes the user's HTTP variables, the browser that can be identified, the cookie information for the storage client, and the request address.

The Request object is an object of the System.Web.httpRequest class, and its

Common properties are as follows:

QueryString: Gets a collection of HTTP query string variables primarily used to collect data sent by GET requests in the HTTP protocol

Form: Gets a collection of form or page variables used to collect request data sent by the Post method

Servervarible: The environment variable collection contains information about the server and the client in-system

Params: It is a collection of three ways, QueryString, form, and servervarible, and does not distinguish between the parameters passed by which way

URL: Gets the URL information about the current request

Userhostname: Gets the DNS name of the remote client

UserHostAddress: Gets the IP host address of the remote client

IsLocal: Gets a value that indicates whether the request is from the local computer

Browser: Gets or sets information about the client browser feature being requested

Common methods are as follows:

BinaryRead (): Performs a binary read of the current input stream with a set number of bytes

SaveAs (): Saving an HTTP request to disk

Partial properties:

protected void Page_Load (object  sender, EventArgs e)        {            = Request.Browser.Browser;             = Request.Url.ToString ();             = Request.ContentLength.ToString ();             = Request.filepath;             = Request.httpmethod;             = request.userhostname;        }

Output Result:

Summary: request is used to obtain various information about the client

 

ASP. NET System Object Request (i)

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.