ASP built-in objects request and response detailed

Source: Internet
Author: User
Tags html page relative

Both the request and response objects are the most commonly used two of the built-in objects provided by the ASP. Between browsers (or other user agents) and Web servers, the exchange of information that occurs in requests and responses can be accessed and managed through two built-in objects in the ASP, called the request and response objects.

Almost all of the work you want to do in an ASP page is to access both objects, and the way you use them affects the efficiency and reliability of your pages. Their main purpose, of course, is to access the values that users send back to the server, either from the

segment of the HTML page or as a query string after the URL, and to create the appropriate output to return to the user, and they can share many of the same factors. For example, two objects can use cookies that are stored on the client computer.

Therefore, we divide the content into two separate parts (each part of the object), and start with the information exchange between the client and the server, and then study each object.

The contents of the study are:

· How the client communicates with the server to deliver the Web or other resources.

· The details of the request and response objects, and the similarities between them.

· How to access the corresponding value through a form and query string.

· How to read or create cookies and store them on the client computer.

· What are the server variables? How to access and modify the HTTP header.

· Describe changes to other related items, such as the use of the customer's certificate.

Communication between the client and the server

To save space, the term "browser" (browser) is used in the following context. But keep in mind that applications that can access Web pages are not just browsers, there are many special applications that download Web pages from sites, such as special client programs designed for visually impaired users or other difficulties with the usual browsers. The most obvious example is the robot that search engines use to access sites on the web. Consider these factors comprehensively, including a common web browser, and the exact words should be the user agent.

Dialog for page requests

When a browser presents a page request to a Web site, it is clear that the server must be told which page it is requesting. The first thing to do is to establish a connection with the server through the domain name, and then provide the full path and name of the requested page. Why do I need full path and name? The web is a borderless environment, so you must create a session to identify each customer (how the ASP will do this later).

This means that every time the server completes sending a page to the customer, the server completely forgets about the customer. Therefore, when the customer requests the next page, it is exactly the same as a new visitor. The server is unable to remember the customer and, accordingly, cannot determine which page they last requested. Because you cannot use a relative path to provide a page, even if the page contains a relative link, for example:

<A HREF=”Download.asp”>Next Page</A>

The browser automatically creates a complete URL for the new page by using the current page's domain and path, or by using the element in the page section, telling the browser what the URL is for all links in a page. For example:

When you point the mouse at a link to a page, you can see it in the browser's status bar. The path to the current page and the current domain or base domain name or base path have been combined with the requested page name.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.