What Is It?
The Request object is simply the information sent to the server by the browser. It can be as simple as someone typing a URL into the Address/Location bar, or as complex as a form.
Most of the information is stored as collections. A collection is a list of named values.
This is the information that follows the question mark (?) on a URL, or the information from a form when submitted using the GET method.
In it's raw form, the information is name=value pairs separated by the ampersand (&).
IIS will parse the raw data and fill the collection so that the values can be accessed by name. For example, this URL:http://local.yahoo.com/?location_city=Tucson&location_state=AZ
will be parsed into a collection of two items:
- Request.QueryString("location_city") with a value of "Tucson"
- Request.QueryString("location_state") with a value of "AZ"
This is the information in the fields of the form when it is submitted using the POST method.
IIS will parse the raw data and fill the collection so that the values can be accessed by name. This is why it is critical that every field in a form has a name. The value of the field will be whatever the user entered/selected.
If you have a text field named "location_city" (users types in "Tucson") and a drop-down list named "location_state" (user selects "AZ"), then this will be parsed into a collection of two items:
- Request.Form("location_city") with a value of "Tucson"
- Request.Form("location_state") with a value of "AZ"
Server variables are meta information about the Request - information primarily reported by the browser and the Internet service provider.
The most common use is to determine which browser (and version) is sending the Request. Browser name and version are both server variables.