Summary
In this chapter you learned how to perform basic HTTP operations with C#. You learned how to access a URL and download the contents of that URL.
C# contains a Uri class. This class allows you to open connections to a URI. You can obtain a stream to the URI. Once you have a Stream, you can read from the URI essentially the same as if you were reading from a file.
It was explained that downloading to a binary file means making an exact copy of the incoming data and is preferred when downloading images, audio and other binary data. Downloading a text file requires you to translate the incoming line breaks to the correct format for your operating system.
In this chapter you learned how to use the Uri and Stream classes to access web pages. This is fine for simple requests; however, for more complex requests you will need to use the WebRequest and WebResponse classes. This topic will be introduced in the next chapter.




