Difference Between Request, Request. Form, and Request. QueryString

Source: Internet
Author: User
Tags servervariables server port

The request itself is a static object of the system and can also be called as an array. For example
Request ("abc") is to obtain the value corresponding to the "abc" in the request array. This array is not fixed, but a set of multiple arrays, including
(QueryString, Form, Cookies, ClientCertificate, ServerVariables) values of these server variable arrays. That is to say, you can traverse these arrays and return the corresponding values through the request, which is convenient to use, once and for all.
Request. the form request member function is not so broad. It only takes values from the form array, that is, the input unit of the <form> tag in the page form (for example, the value passed by <input type = text>. Then, you cannot obtain index. asp in the link string through form? Abc = 123.
Another method is request. QueryString ("abc"). You can obtain the parameters passed by the QueryString link string.
These three methods can be distinguished based on the transmission data mechanism of http. Request. form can obtain the data submitted in post mode, and requst. querystring can obtain the data submitted in get method, while request can obtain the data transmitted in both methods.
According to the transmitted data volume, request. form can transmit unlimited data, while request. querystring can only transmit 2 K data volume.
According to the speed, request. qeurystring will be slightly faster than request. form
It is the most convenient and best to use. The request itself is direct and can be obtained no matter how the data is transmitted. The performance is decreased slightly and negligible, common requests ("abc") can be used.
Request. Form: GET the data submitted in POST mode (receive the data submitted by Form); Request. QueryString: GET the address bar parameters (data submitted in GET mode)
Request: contains the preceding two methods (obtain the data submitted by the GET method first), which are searched in QueryString, Form, and ServerVariable.
And sometimes different results are obtained. If you only need a piece of data in Form, but you use Request instead of Request. Form, the program will also search for it in QueryString and ServerVariable. If the same name exists in your QueryString or ServerVariable, you don't get the expected value.

Parameters in Request. ServerVariables

Request. ServerVariables ("Url") returns the server address
Path information provided by the Request. ServerVariables ("Path_Info") client
Request. ServerVariables ("Appl_Physical_Path") physical path corresponding to the application Metadatabase path
Request. ServerVariables ("Path_Translated") path obtained by ing from virtual to physical
Request. ServerVariables ("Script_Name") name of the script to be executed
Request. ServerVariables ("Query_String") query string content
Request. ServerVariables ("Http_Referer") Request string content
Request. ServerVariables ("Server_Port") server port number that receives the Request
Request. ServerVariables ("Remote_Addr") sends the Request to the IP address of the remote host
Request. ServerVariables ("Remote_Host") remote host name that sends the Request
Request. ServerVariables ("Local_Addr") returns the server address that receives the Request.
Request. ServerVariables ("Http_Host") returns the server address
Request. ServerVariables ("Server_Name") server host name, DNS address, or IP address
Request. ServerVariables ("Request_Method") Request methods such as GET, HEAD, and POST
Request. ServerVariables ("Server_Port_Secure ")
If the server port for receiving the Request is a secure port, it is 1. Otherwise, it is the name and version of the protocol used by the 0 Request. ServerVariables ("Server_Protocol") server.
Request. ServerVariables ("Server_Software") to respond to the Request and run the name and version of the Gateway's server software

Request. ServerVariables ("All_Http") all HTTP headers sent by the client, prefixed with HTTP _
Request. ServerVariables ("All_Raw ")
The results of all HTTP headers sent by the client are the same as those sent by the client. The metadatabase path of the HTTP _ Request. ServerVariables ("Appl_MD_Path") application is not prefixed.
Request. ServerVariables ("Content_Length") length of the content sent by the client
Request. ServerVariables ("Https ")
If the request passes through the secure channel (SSL), ON is returned. If the request comes from an insecure channel, OFF is returned.
Request. ServerVariables ("Instance_ID") ID of the IIS instance
Request. ServerVariables ("Instance_Meta_Path") MetaBase path of the IIS instance in response to the Request
Request. ServerVariables ("Http_Accept_Encoding") returns content such as gzip and deflate.
Request. ServerVariables ("Http_Accept_Language") returns the content, for example, en-us.
Request. ServerVariables ("Http_Connection") return content: Keep-Alive
Request. ServerVariables ("Http_Cookie") returns content such as nVisiT %
2 DYum = 125; ASPSESSIONIDCARTQTRA = large; aspsessionidcaqqtsulfate = lkjjplabillpcogjgamkam; ASPSESSIONIDACRRSSRA = DK HHHFBBJOJCCONPPHLKGHPB
Request. ServerVariables ("Http_User_Agent ")
Returned content: Mozilla/4.0 (compatible; MSIE6.0; WindowsNT5.1; SV1) number of bits for Request. ServerVariables ("Https_Keysize") secure socket layer connection keywords, such as 128
Request. ServerVariables ("Https_Secretkeysize") the server verifies the number of digits of private keywords, such as 1024.

Request. ServerVariables ("Https_Server_Issuer") issuer field of the server certificate
Request. ServerVariables ("Https_Server_Subject") subject field of the server certificate
Request. ServerVariables ("Auth_Password ")
When the basic authentication mode is used, the customer enters the password Request. ServerVariables ("Auth_Type") in the password dialog box ")
Is the user name used by the server to verify the user's authentication method Request. ServerVariables ("Auth_User") when a user accesses a protected script.
Request. ServerVariables ("Cert_Cookie") unique client certificate ID
Request. ServerVariables ("Cert_Flag ")
The customer certificate is marked as a token. If a client certificate exists, bit0 is 0. If the client certificate verification is invalid, bit1 is set to 1.
Request. ServerVariables ("Cert_Issuer") issuer field in the user certificate
Request. ServerVariables ("Cert_Keysize") number of digits of the secure socket layer connection keyword, such as 128
Request. ServerVariables ("Cert_Secretkeysize") the server verifies the number of digits of a private keyword, such as 1024.
Request. ServerVariables ("Cert_Serialnumber") serial number field of the customer certificate
Request. ServerVariables ("Cert_Server_Issuer") issuer field of the server certificate
Request. ServerVariables ("Cert_Server_Subject") subject field of the server certificate
Request. ServerVariables ("Cert_Subject") subject field of the client certificate
Request. ServerVariables ("Content_Type") data type of the form content or HTTPPUT sent by the customer
In. net learning and development, the basics are important. Now I will summarize some of the most basic. net knowledge to learn more.

In the process of webpage development, we need to accept the value from the page, which is also the basic content we need to know.
Use Request. Form. ASP searches from the FORM set. Using Request, ASP searches in the following order: 1. QueryString 2. Form 3. Cookies
4. ClientCertificate 5. ServerVariables
If the same variable name in the same Form exists in QueryString, the value in Form is not returned, but in QueryString.
Request. form: obtain the data Request submitted by the front-end form in POST mode. queryString: GET the address bar parameters (data submitted in GET mode) Request: contains the preceding two methods (GET data submitted in GET mode first). The two methods have different receiving methods, there is also the problem of transferring the data volume:
There is no limit on the data that the Request. form method can receive, while Request. QueryString can only receive data smaller than 2 kB. Of course, the latter is faster than the former.
Generally, the request. QueryString method is used to request a query from a database, because there are only a few keywords in the query, and there is no need to use the request. form method, resulting in slow query speed. In addition, the request. QueryString method also displays data in the address bar of the client browser, which is less secure.
The request. form method does not have the preceding problem. Therefore, it is widely used for data submission and user login in multiple text fields.
The request object may not specify the specific QueryString or form method, such as request ("variable"), because it can be automatically recognized,
However, it is better to specify it. Otherwise, it may take a little time for it to determine its own access time, affecting the program execution efficiency.

 

Difference Between Request, Request. Form, and Request. QueryString

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.