AddHeader
Appendtolog
BinaryRead
Binarywrite
Buffer
CacheControl
Charset
Clear
ClientCertificate CLIENTCERTIFICATE
ContentType
End
Servervariables
EXPIRES
Expiresabsolute
Flush
FORM
IsclientConnected
PICS
QueryString
REDIRECT
Request.cookies
REQUEST
Response.cookies
Response
STATUS
Totalbytes
Write
AddHeader AddHeader method Add HTML title with the specified value. This method often adds a new HTTP title to the response. It does not replace the existing same name title. Once the title is added, it will not be deleted. This method is for advanced users only. If the other Response method provides the features you need, it is recommended that you use this method. Grammatical response.addheader name, value
parameter
Name
The name of the new title variable.
Value
The initial value stored in the new title variable.
Note To avoid named naming, no next line characters (_) are not included in Name. ServerVariables collection interprets the underscore characters in the title as a backslash. For example, the following script enables the server to find a title name called My-HEADER. <% Request.servervariables ("http_my_header")%> Because the HTTP protocol requires all the titles must be sent before the content, you must send it to the client in any output (such as an output generated by HTML or WRITE method) AddHeader calls in the script. However, when the buffer attribute is set to True, the exception is performed. If the output is buffered, you can call the AddHeader method anywhere in the script, as long as it is executed before Flush. Otherwise, a run error will result in the call to AddHeader. The following two .asp files explained this. ------- File1.asp ---------
<% Response.addheader "warning", "Error Message Text"%>
Some text on the web page.
Html>
In the previous example, the page is not buffered. However, because of the server will output some text on the web page
The AddHeader method is called before sending it to the client, so the script can work normally. If you change the order, the call to the AddHeader method will generate a runtime error. ------ File2.asp ----------
<% Response.buffer = true%>
Here's Some Text On Your Web Page.
<% Response.addheader "Warning", "Error Message Text"%> Here's Some More Interesting and illuminating text.
<% Response.flush%>
<% = Response.write ("Some String")%>
Html>
In the previous example, the page is buffered, and the result is that the server will send the output to the client until all the ASP scripts are executed or the FLUSH method is called. The call to AddHeader can appear anywhere in the script, as long as the Flush call is called. In the previous example, if the call to AddHeader appears after the call to the Flush, the script will generate a runtime error. You can send multiple copies of the same title in this way, such as using the WWW-Authenticate title. Example The following example uses the AddHeader method to request the client to use Basic authentication. <% Response.addheader "WWW-Authenticate", "Basic"%> Note which verification is to be notified by the previous script not inform the client browser. If you use this script in a web application, be sure to enable the Basic verification of the web server. For reference to the Response object, see Flush, Write, Buffer
The appendtolog appendtolog method adds a string to the end of the web server log entry. This method can be called multiple times in the same part of the script. Each time you call this method, you will add the specified string in the current entry. Grammatical response.Appendtolog string
parameter
String
To add text to the log file. Since the fields in the IIS log are separated by commas, the comma is not included in the string (,). The string is the maximum length of 80 characters.
Note To enable the specified string to log files, you must enable the URI Query option for the site Extended Logging property page, which is the active site to log in. For more information on configuring Extended Logging, see Customizing W3C Extended Logging. Apply to Response object
The BinaryRead BinaryRead method obtains data from the client to the server from the client as part of the POST request. This method gets data from the client and stores it in SafeArray. SafeArray is an array containing dimension and boundary information. Syntax Variant = Request.binaryRead (count)
parameter
Variant
An array of unsigned numbers returned by this method. The type of parameter is VT_Array | VT_UI1.
count
Before execution, specify the number of bytes to be read from the client. After this method returns,
Count will contain the number of bytes successfully read from the client. The total number of bytes that actually read will be less than or equal to
Request.totalbytes.
Note BinaryRead method is used to read the raw data from the client as part of the POST request. This method is used to access data under the bottom layer, and the Request.Form set is used to view the table data sent in the announcement request. Once binaryRead is called, reference to any variables in the Request.form collection will cause errors. Conversely, once a variable in the Request.Form collection is referenced, calling binaryWrite will also cause errors. Keep in mind that if the variable is not specified when the variable in the Request collection belongs to it, the Request.Form collection is searched and enforces the above rules. Example The following examples use the binaryRead method to place the requested content into a secure array. <%
Dim binread
DIM Bytecount
Bytecount = Request.totalBytes
Binread = Request.binaryRead (Bytecount)
%>
For reference objects, please refer to TotalBytes, ClientCertificate, Cookies, Form, QueryString, ServerVariableSbinaryWrite BinaryWrite method Write the specified information to the HTTP output without any character conversion. This method is used to write non-string information (such as binary data required for client applications). Grammatical response.binaryWrite Data
parameter
Data
Write data from HTTP output.
Example If there is an object that generates a byte array, call binaryWrite as follows to send these generated bytes to the client application. <%
Set bingen = server.createObject (my.binarygenerator)
Pict = bingen.makepicture
Response.binaryWrite Pict
%>
For reference to the Response object, see WRITE
The Buffer Buffer property indicates whether the buffer page is output. When the buffer page is output, only all server scripts of the current page are processed or when the Flush or End method is called, the server will send the response to the client. The server cannot set the buffer attribute after sending the output to the client. Therefore, response.buffer should be called in the first line of .asp file. Grammatical response.buffer [= flag]
parameter
Flag
Specifies whether the buffer page output can be one of the following values.
Value Description False does not buffer. This value is the default value. The server sends the output to the client while processing the script. TRUE does not send a response to the client unless all ASP scripts are processed or in the current page or the FLUSH or End method is called.
Note If the current ASP script is built to True, but the Flush method is not called, the server will keep the client's request. Since the server does not have to create a new connection for each client, it saves time. However, the buffer will block the client display response before the server does not process all the scripts of the previous page. For long scripts, it is possible to feel delayed. You can set the script buffer default value in the ASPBufferingOn property in the dollar database. For more information on using metadata, see the IIS metadata in the programmer reference. For the response object, please refer to Flush, End
The CacheControl CacheControl property ignores the Private default value. When you set its properties as public, the proxy server can buffer the output generated by the ASP. Grammatical response.cachecontrol [= cache control header]
parameter
Cache Control HEADER
The buffer memory control title can be a public or private.
Apply to Response object
The Charset Charset property attached the character set name (such as ISO-Latin-7) to the back of the Content-Type title in the Response object. Grammatical response.charset (charsetname)
parameter
Charsetname
Specify the string of the character set of the page. The name of the character set will be attached to
Behind the Content-Type header in the Response object.
Example For ASP pages that do not contain the response.charset property, the Content-Type title will be: Content-Type: Text / HTML
If the same .asp file contains <% response.charset ("ISO-LATIN-7")%>
The content-type title will be: content-type: text / html; charset = ISO-LATIN-7 comment inserts it into the Content-Type header regardless of the character set represented by the string. If a page contains multiple tags containing the Response.Charset, each response.charset will replace the previous CharsetName. In this way, the character set will be set to the last instance of Response.Charset in this page. On the Macintosh system, the default u.s. character set setting is not ISO-Latin-1. When processing a document, the personal web server for the Macintosh system is automatically converted from the Macintosh character set to ISO-LATIN-1. In U.S. Version, if the Response.Charset conversion character set is not used, and all the pages are assumed in the U.S. Macintosh character set for the personal web server used for the Macintosh system. Apply to Response object
The Clear Clear method deletes all HTML output in the buffer. However, the CLEAR method only deletes the response body without deleting the response title. You can use this method to handle error conditions. Note that if the response.buffer is set to True, the method will result in a runtime error. Grammatical response.clear
See End, Flush, please refer to Response object
ClientCertificate CLIENTCERTIFICATE Gather Get the verification field from the web browser publishing request (specified by the X.509 standard). If the web browser uses the SSL3.0 / PCT1 protocol (that is, it uses the URL at https: // instead of http: //) Connect the server and server request verification, the browser will send the verification field. If no authentication is sent, the ClientCertificate collection will return EMPTY. The web server must be configured to request client authentication before you can use the ClientCertificate collection. Syntax Request.ClientCertificate (key [subfield])
parameter
Key
Specifies the name of the verification field to get. Client verification includes the following fields.
Value Certificate Press the binary stream string in the ASN.1 format, including complete verification content. A set of flags of Flags, providing other client authentication information. You can set the following markers: CecertPresent - Current client verification. CEUNRECognizedissuer - The last verification of the unknown publisher. Note To use the above logo, you must include the client verification containing files in the ASP page. If you are using VBScript, you should contain Cervbs.inc. These files are installed in the / inetpub / asksamp / Samples directory. Issuer contains a string of the list of subfield values, which contains information about verifying publishers. If this value is specified without subfield items, the ClientCertificate collection returns a list of comma-separated subfields. For example, C = US, O = VeriSign, etc. SerialNumber contains a string of the verified serial number, and the serial number is represented by a 16-binary ASCII code separated by the hyphen (-). For example, 04-67-f3-02. Subject contains a string of the list of subfield values, which contains topic information about validation. If this value is specified without subfield items, the ClientCertificate collection returns a list of comma-separated subfields. For example, C = US, O = VeriSign, etc. ValidFrom specifies when verification is valid. This date follows the VBScript format and changes with the country (regional) settings. For example, in the United States, it can be expressed as 9/26/96 11:59:59 pm.validuntil Specifies when verification expires. Subfield
Optional parameters, used to search separate fields by subject or Issuer keyword. This parameter is added as a suffix
KEY parameters. For example, Issuero or SubjectCN. The following table lists some universal
Subfield value.
Value significance c Specifies the name of the original country (region). CN Specifies the name of the public user. (This subfield is only used with the Subject keyword.) GN specifies a given name. I Specify a group of first letters. L Specify the location. O Specifies the company or organization name. The name of the OU designated institution. S designated state or province. T Specify the title of this person or organization.
Unlike the values listed in the above list, the value of Subfield can be identified by the ASN.1 identifier. The format of the ASN.1 identification is a series of numbers separated by the period (.). For example: 3.56.7886.34.
Note You can traverse the ClientCertificate collection by keywords. The following example demonstrates this. <%
For Each Key In Request.ClientCertificate
Response.write (Key & ":" & Request.ClientCertificate (Key) & "
")
NEXT
%>
Example The following example uses the Subject keyword test client verification exists. <%
If Len ("Subject") = 0
Response.write ("No Client Certificate Was Presented)
END IF
%>
The following example obtains the public name of the company that publishes the client authentication. <% = Request.ClientCertificate ("issuercn")%>
The following example checks the organization name of the client verification topic. <%
IF (Request.ClientCertificate ("Subject") = "MSFT")
Response.write ("Good choice!") Endiff
%>
The following example shows when client authentication expires. This Certification Will Expire ON
<% = Request.ClientCertificate ("Validuntil")%>
The following example is not known to test the publisher of the client authentication using the FLAGS keyword. The first line of include commands allow the script to use the named flag CEUNRECognizedissuer.
<%
IF Request.ClientCertificate ("flags") and ceunrecognizedissuer the
Response.write "Unrecognized Issuer"
END IF
%>
For reference objects, please refer to Cookies, Form, QueryString, ServerVariables
The ContentType ContentTYPE property specifies the HTTP content type of the response. If ContentType is not specified, the default is Text / HTML. Grammatical response.contentType [= contentType]
parameter
ContentType
Describe the string of the content type. This string is typically formatted as types / subtype, where the type is a regular content scope and subcategory is a specific content type. For a complete list of supported content types, see Web browser documents or current HTTP specification.
Example The following example sets the content type to Channel Definition Format (CDF). <% Response.contentType = "Application / X-CDF"%>
The following example sets the ContentType property to another value. <% Response.contentType = "text / html"%>
<% Response.contentType = "image / gif"%>
<% Response.contenttype = "image / jpeg"%>
Apply to Response object
The End End method causes the web server to stop processing scripts and returns current results. The remaining content in the file will not be processed. Grammatical response.end
Note If the response.buffer is set to TRUE, calling Response.end will buffer output. If you don't want to return the output to the user, you should call <%
Response.clear
Response.end
%>
See Buffer, Clear for use in response objects
ServerVariables ServerVariables sets retrieves a predetermined environment variable. Syntax Request.ServerVariables (Server Environment Variable)
parameter
Server environment variable
Specifies the server environment variable name to retrieve. You can use the values listed below.
Variable Description All HTTP Title Files sent by the all_http client. All_RAW retrieves all the titles in the form in the form. All_raw and all_http are different, all_http places http_ prefix in front of the title file name, and the title name is always capitalized. When using all_raw, the title name and value appear only when the client is sent. Appl_md_path retrieves the metabological path of the ISAPI DLL (WAM) Application. Appl_physical_path retrieves the physical path corresponding to the metadata path. IIS returns the value by converting the Appl_MD_Path to the Physical (Directory) path. Auth_password This value is input to the client's authentication dialog. This variable is only available when using basic identification. Auth_type This is the server for verifying the user's verification method when the user has access protected script. Auth_user is not identified by the username. The unique ID of the CERT_COOKIE client verification is returned in a string. Can be used as a signature of the entire client verification. Cert_flags If there is a client verification, Bit0 is 1. Bit1 is set to 1 if the verification person of the client authentication is invalid (not in the CA list recognized by the server). The enactor field in Cert_issuer User Verification (O = MS, OU = IAS, CN = User Name, C = USA). The Cert_Keysize Secure Socket Tag layer The number of bits of the keyword, such as 128. The Cert_secretKeysize server verifies the number of bits of the private key. Such as 1024. Cert_serialnumber user authentication serial number field. Cert_server_issuer The issuer field of server authentication. Cert_server_subject server authentication primary field. Cert_subject The primary field verified by the client. The Content_length client issues the length of content. Content_type content data type. Use with additional information, such as HTTP query GET, POST, and PUT. The revision of the CGI specifications used by the Gateway_Iterface server. The format is CGI / Revision. HTTP_
These virtual paths can be used to access scripts with the Path_Info server variable. If the information comes from the URL, it has decoded the server before reaching the CGI script. Path_TranslatedPath_info Converted version, the variable acquires the path and performs the necessary mapping by virtual to physical. Query_String Query the information after Question mark (?) In the HTTP request. Remote_addr issues the IP address of the requesting remote host. Remote_host issues a request host name. If the server doesn't have this information, it will set an empty Mote_Addr variable. Remote_user The unmapped username string sent by the user. This name is the name of the user's actual sector, which is relative to the server that verifies the filler modified. Request_method This method is used to make a request. Equivalent to GET, HEAD, POST, etc. for HTTP. Script_name executes the virtual path of the script. URL used for self-reference. Server_name appears in the server host name, DNS pseudonym, or IP address in the quote UAL. Server_port sends the port number of the request. Server_port_secure contains a string of 0 or 1. If the security port processes the request, it is 1, otherwise 0. Server_Protocol Requests the name and revision of the information protocol. Format is protocol / revision. Server_software answers the name and version of the server software for the request and run the gateway. The format is Name / Version. The URL provides the basic part of the URL. Note If the title file sent by the client cannot be found in the above table, you can add HTTP_ prefix to the title file name in calling request.serverVariables to retrieve its value. For example, if the client sends title files SomeneWheader: SomnewValue
You can retrieve SomnewValue <% Request.ServerVariables ("http_somenewheader")%> by using the following syntax
You can use a rearray to loop all server variable names. For example, print out all of the server names using the following scripts.
Server Variable b> td> | value b> td> tr>
<% For each name in request.servervariables%> |
<% = Name%> TD> | <% = Request.ServerVariables (name)%> td> tr>
Table> <% Next%> Example The following example displays some server variables using the Request object. ALL_HTTP Server Variable = <% = Request.ServerVariables ("all_http")%> Content_length server variable = <% = Request.ServerVariables ("Content_length")%> Content_Type Server Variable = <% = Request.serverVariables ("Content_Type")%> <% = Request.ServerVariables ("Query_String")%> Server_Software Server Variable = <% = Request.ServerVariables ("Server_Software")%> Html> The next example uses the ServerVariables collection to insert the server name into a hypertext link.
/scripts/mypage.asp">link to mypage.asp For reference object, please refer to ClientCertificate, Cookies, Form, QueryString The Expires Expires property specifies how much time is there a pager expiration in the browser buffered. If the user returns to this page before a page expires, the version in the buffer is displayed. Syntax response.expires [= number] parameter Number How many minutes are there in an expiration. Set this parameter to 0 to make the cache page immediately expire. Note If this property is set multiple times on one page, the shortest time is used. See Expiresabsolute for application to Response objects The ExpiresAbsolute ExpiresabSolute property specifies the expiration date and time of the page cached in the browser. If the user returns to the page before the user is returned to the page, the cached page is displayed. This home page expires on the same day if not specified. If the date is not specified, the home page expires at the specified time of the script running on the day. Grammatical response.expiresabsolute [= [date] [Time]] parameter date Specify the expiration date of the page. This value is sent in the expiration header that conforms to the RFC-1123 date format. Time Specify the expiration time of the page. This value is converted to a GMT time before the expiration title is sent. Note If the property is set multiple times in the page, the date and time of the earliest expiration is accurate. Example The following sample specified page expires at 1:30 pm on May 31, 1996. <% Response.expiresabsolute = # May 31,1996 13:30: 15 #%> For the response object, see Expires The Flush Flush method immediately transmits the output in the buffer. This method will result in runtime errors if the response.buffer is set to TRUE. Grammatical response.flush Note If the Flush method is called on the ASP page, the server will respond to the request on the page. Apply to Response object The Form Form set retrieves the value of the table element in the HTTP request body by using the form of the POST method. Syntax Request.form (Element) [(index) | .count] parameter ELEMENT Specifies the name of the table element to be retrieved. Index Optional parameters, using this parameter can access one of multiple values in a parameter. It can be 1 to Any integer between Request.form (Parameter) .count. Note The Form set is indexed by the name of the parameter in the text. The value of Request.Form (Element) is an array requesting all ELEMENT values in the body. Determine the number of values in the parameter by calling Request.form (Element) .count. If the parameter is not associated with multiple values, the count is 1. If the parameters are not found, the count is 0. To reference a single value in a table element with multiple values, you must specify an index value. The index parameter can be any number from 1 to REQUEST.FORM (Element) .count. If one of the plurality of table parameters is referenced, the index value is not specified, the returned data will be a comma-separated string. When using the request.form parameter, the web server analyzes the HTTP request body and returns the specified data. If the application requires unsatisfactory table data, you can access the data by calling the request.form without a parameter. Use the revision to traverse all data values in the table request. For example, the user fills in the form by specifying two values, chocolate and butterscotch. For FavoriteFlavor parameters, you can retrieve these values using the following scripts. <% For Each Item in Request.form ("FavoriteFlavor") Response.write item & " NEXT %> The script is shown below. Chocolate ButtersCotch Use the for ... Next loop to generate the same output, as shown in the following script. <% For i = 1 to request.form ("favoriteflavor"). Count Response.write Request.form ("Favoriteflavor") (i) & " NEXT %> Use this reset to display the parameter name. As shown in the following script. <% For Each X in Request.Form%> Request.form (<% = x%>) = <% = Request.form (x)%> <% Next%> This script displays the following information on your browser. Favoriteflavor = chocolate Favoriteflavor = ButtersCotch Example consider the following table. |