the complete webmaster
tutorials reviews reference
ASP
CGI
FrontPage
HTML
Java
JavaScript

Sponsored by El Scripto

Visit the Mortgage Loan Place for Home Loans and also click here to find VA Loans on our site.

Promote your website

home / articles / asp

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 you’ve ever programmed a web application and dealt with the intricacies of HTTP, you’re 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 Objects
Page 2: COM is the Basis for Microsoft's Object Strategy
Page 3: Using Objects and Object Models
Page 4: Active Server Pages Objects
Page 5: Requests and Responses: An HTTP Perspective
Page 6: Using the Request Object
Page 7: A Change of Method
Page 8: Using Other Collections
Page 9: Tip of the Week and Summary

Author: Keith Cox
Date: 12/29/97

More articles about Active Server Pages
More articles by Keith Cox
Author Biography

Get thousands of people selling your product online for FREE
write for us about us advertise

Copyright 1997, 1998 A Big Lime. All rights reserved.

body>