Request object| Contents | ASP | |
|---|---|---|
| Request.BinaryRead method | Returns the requested number of binary bytes from those sent by the client. | 1 |
| Request.ClientCertificates collection | Properties of the client certificate, when one is sent by the browser. | 1 |
| Request.Cookies collection | Potentially two-dimensional read-only collection of persistant client values. | 1 |
| Request.Form collection | Data passed to the server via a POST form. | 1 |
| Request.QueryString collection | Data passed to the server as a part of the URL, as with a GET form. | 1 |
| Request.ServerVariables collection | A collection of standard CGI values. | 1 |
| Request.TotalBytes property | The size of the client request, used with BinaryRead. | 1 |
The Request object does not have a
traditional default member. Instead, when accessing the object as a
collection, it returns the first match found after searching its five
member collections for the key, in this order:
Each of these collections contains a collection of IStringList collection items.
Using the Request collection allows a
more concise and flexible access method for form variables; by using
Request("id") rather than Request.Form("id"), you can pass the id variable via a POST form, or a simple link
(from a search results page, for example) interchageably.
It is best to avoid using the Request
collection to access the Request.ServerVariables collection for two
reasons: first, it is the last collection searched, which means the
search will take longer; and second, an item from another collection
with the same name will supercede the value, allowing exploits and
causing bugs. In the following example, a malicious user could easily
pass a query string of ?LOGON_USER=Administrator.
IfRequest("LOGON_USER")=""Then' WRONG! Any Request collection could provide this value!Response.Status="401 Unauthorized"Response.EndEndIf
Fori=1ToRequest("field").Count' IStringList collections begin at 1' use valueNext