How To Use WebClient Class To Make HTTP Requests (328820)



The information in this article applies to:

  • Microsoft Visual C# .NET (2003)
  • Microsoft .NET Framework Class Libraries 1.1
  • Microsoft Visual C# .NET (2002)
  • Microsoft .NET Framework Class Libraries 1.0

This article was previously published under Q328820

SUMMARY

This article describes how to use the Microsoft .NET Framework WebClient class to make HTTP requests with the WebClientSample.exe sample console application.

MORE INFORMATION



The WebClientSample.exe sample application supports the following features:
  • Basic authentication.
  • Integrated Windows authentication.
  • Proxy authentication.
  • Save output to a local file.
  • The HTTP GET method, the HTTP POST method, and the HTTP PUT method.
  • Proxy server.
  • Secure Sockets Layer (SSL).

Note The .NET Framework does not support autoproxy.

Download the Sample Application


The following file is available for download from the Microsoft Download Center:
Release Date:

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 secure servers that prevent any unauthorized changes to the file.


Note The Download Center file applies to the following operating systems:
  • Microsoft .NET Server 2003 (running only on Intel-based computers).
  • Microsoft Windows XP.
  • Microsoft Windows 2000.
  • Microsoft Windows NT.

The WebClientSample.exe file contains the following files:
WebClientSample.sln1 KB
WebClientSample.csproj4 KB
Class1.cs19 KB
AssemblyInfo.cs3 KB
App.ico1KB
Post.asp1KB

Modification Type:MinorLast Reviewed:8/4/2004
Keywords:kbdownload kbhowto kbfile kbhttp KB328820 kbAudDeveloper