Chapter 10: HTTP with .NET


Overview

In the previous two chapters we examined how to access the network protocols directly through the Socket class, which allows for precise control over what is sent and received on a socket. While the Socket class is powerful, it is also cumbersome to implement higher-level protocols, such as Hypertext Transfer Protocol (HTTP), because the application has to handle the network transactions as well as build and parse the HTTP commands, which can be quite complex. This chapter introduces the HTTP- related classes, an application-level protocol built on top of TCP for accessing Web resources. The .NET Framework Web classes encapsulate the TCP details for retrieving Web resources into simple and easy- to-use classes.

This chapter is divided into several parts . First, we ll introduce the basics of accessing HTTP-based Web resources via the HttpWebRequest and HttpWebResponse classes. This will be followed by the WebRequest and WebResponse classes that expose a uniform method of accessing any network resource based on request-response , such as files and HTML that can be extended to support other application-level protocols, including FTP and file sharing.

Following that, we ll cover more advanced topics such as the asynchronous model for accessing Web resources, as well as connection management, establishing secure connections over a Secure Sockets Layer (SSL), and application models that use Web-based classes from different areas (ASP.NET, console applications, etc.). We ll finish the discussion with code-access security considerations when using the Web classes.




Network Programming for the Microsoft. NET Framework
Network Programming for the MicrosoftВ® .NET Framework (Pro-Developer)
ISBN: 073561959X
EAN: 2147483647
Year: 2003
Pages: 121

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net