|
The request object has a lot of different collections,
properties, and events methods. The outline is as follows:
- Properties
- Collections
- ClientCertificate
- Cookies
- Form
- QueryString
- ServerVariables
- Methods
The TotalBytes Property returns the total number of
bytes that have been posted to the server. This value is read only. This is not
used much however it does come in handy sometimes.
The first too collections that we will look at are the
Form and Querystring collections. These are the most commonly used
in ASP although the others are very useful once you get the hang of things.
Both the Form and the QueryString
collections are related to the
The Cookies collection is pretty straight forward.
It allows you to get and set values for a cookie that is stored on the clients
machine. Cookies are not evil as some people have said they are. They are an
efficient and safe way for a web programmer to store information about a user.
Lets say you wanted to allow the user to set the background color on your web
page so that every time they come to the site they see their chosen colors. How
would you know it was them and what their settings are. There are two
ways: 1) Have them log in every time and then store their info in a database
that you pull it from. 2) Store a cookie with this information in it on their
machine.
The ClientCertificates Collection is very similar
to the Cookies collection however it is used to gain information about the
certificate that the user connected with. This is used in secure sites so I will
not expand upon it very much here.
The ServerVariables collection is a very useful
collection that allows you to gain access to a number of variables relating to
the server and the request. The variables are sent to the server in the form of
an HTTP header which is information hidden for the user. I will show you in the
examples how to retreive these value and also put them to use.
The BinaryRead method allows you to read in binary
format the information set to the server. This method is not used much unless
you are dealing with uploading files. We will expand more on this later.
|