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) { TextBox1.Text = Request.Browser.Browser; TextBox2.Text = Request.Url.ToString (); TextBox3.Text = Request.ContentLength.ToString (); Textbox4.text = Request.filepath; Textbox5.text = Request.httpmethod; Textbox6.text = Request.userhostname; }
Output Result:
Summary: request is used to obtain various information about the client
"Recommended"
1. summarize the use instance of the Request object for ASP .
2. share a Request object small case
3. sharing the Request object in ASP five methods to obtain client data
4. Talk about the use of both the request and response objects