How to use the new System.Net classes to create an HTTP client (303436)



The information in this article applies to:

  • Microsoft Visual C# .NET (2002)
  • Microsoft Visual C# 2005

This article was previously published under Q303436

SUMMARY

The CSharpHTTP.exe file sample that is provided through this article shows how to use the new System.Net classes to create an HTTP client that uses the HttpWebRequest and HttpWebResponse classes. This sample shows how to use the following HTTP verbs:
  • HEAD
  • GET
  • POST
  • PUT
It also demonstrates how to handle cookies and certificate errors when you use Secure Sockets Layer (SSL). This sample is based on the VBHTTP sample that is included with the Platform Software Development Kit (SDK).

MORE INFORMATION

The following file is available for download from the Microsoft Download Center:
Release Date: August 23, 2001

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to obtain Microsoft support files from online services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. The Csharphttp.exe file contains the following files:

Assemblyinfo.cs3 KB
Csharphttp.csproj5 KB
Csharphttp.csproj.user2 KB
Csharphttp.sln1 KB
Csharphttp.suo8 KB
Csharphttp_debug.projdata9 KB
Form1.cs47 KB
Form1.resx2 KB
Licenses.licx2 KB


Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site: For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:

Modification Type:MinorLast Reviewed:10/4/2006
Keywords:kbhowto kbdownload kbfile KB303436 kbAudDeveloper