Introduction
- Using the URL Class
- Downloading a Page
- Downloading an Image
- Parsing Data
The HTTP protocol is used to exchange information between an HTTP server and an HTTP client. Usually the HTTP client is a user with a web browser; however, this is not always the case. Sometimes, the HTTP client is a bot, which is a program using the web. C# provides many classes that allow C# programs to use web pages. In this chapter, these classes will be introduced.
The concept of a web page is very important to the HTTP transfer process. Information that you would like to access, using HTTP, will be on a specific web page. The web browsing experience is based on many different web pages. For example, every time a link is clicked, the browser usually moves to a new web page. Likewise, the information you would like to access, using HTTP programming, is on such a page.
Each of these pages has a unique address, which is used to identify that page. This address is the Uniform Resource Locater (URL). The quickest way to find the URL of your "page of interest", is to navigate directly to that page with a web browser. The web browser's address line will show the address of the desired page.
As seen in Figure 3.1, the browser is currently at the URL address of http://www.httprecipes.com/1/3/time.php
. If you want to collect data from this web page, you would use this URL.
Figure 3.1: The Address of a Web Page





