Requests and Responses: An HTTP Perspective
The HTTP protocol is a request/response protocol. This means that a client, such as a web browser, sends a request to the web server in the form of an HTTP request message. This request contains, as part of its' content, a request method, Uniform Resource Identifier (URI), and protocol version followed by a MIME-like message. Uniform Resource Identifiers are simply formatted strings, which identify--via name, location, or any other characteristic--a resource - affectionately known as a URL.
Once this message reaches the server, an attempt is made to satisfy the request. The server responds with a status line, including the message's protocol version and a success or error code and the requested resource. If there are embedded images or objects in the HTML response, the Web browser makes subsequent requests for each embedded object.
The Request and Response objects serve to simplify your interaction with the HTTP protocol. The good news is if youve ever programmed a web application and dealt with the intricacies of HTTP, youre already familiar with some of the functionality offered by these two objects. If you haven't, you'll be pleasantly surprised at the simplicity of the programming involved.
The Request Object
The Request object contains information about the current HTTP request. Strictly speaking, the information being passed to you, the server, from the requesting browser. Prior to using this information, the Active Server Page engine parses the HTTP request and places the information in a series of collections. As we proceed with our discussion, it will become evident that the entire Request Object is simply a big container for five different collections. I'll talk more about the anatomy of a collection a little later on, for now review the following table:
Collections Contained in The Request Object
| Property | Description |
| ClientCertificate | A collection of certificates identifying the requesting browser. If this collection is empty, the requestor is not currently using certificates for authentication purposes. |
| Cookies | A collection of HTTP 1.1 compliant cookies or pieces of data sent from the browser. |
| Form | A collection of named variables for the current form. These variables are populated based on the submit method of the form being POST and are dependent on the name attribute of the HTML INPUT tag being valid. |
| QueryString | A collection of variables for the current form. These variables are populated based on the submit method of the form being GET. |
| ServerVariables | A collection of web server-based environment variables. |
In your Active Server Page script, you will use this object to retrieve information about the request such as form variables, query string information, cookies, and certificates.
Page 1: A Brief History of ObjectsAuthor: Keith Cox
Date: 12/29/97
More articles about Active Server Pages
More articles by Keith Cox
Author Biography