INFO: Guidelines to Use WinHttp, Managed Code APIs (System.Net classes) or WinInet (821876)



The information in this article applies to:

  • Microsoft .NET Framework 1.0
  • Microsoft .NET Framework 1.1
  • Microsoft Windows HTTP Services (WinHTTP) 5.0
  • Microsoft Windows HTTP Services (WinHTTP) 5.1
  • Microsoft Windows Internet Services (WinInet)

SUMMARY

This article describes the differences between Windows HTTP Services (WinHTTP), managed code APIs (System.Net namespace classes), and Windows Internet API (WinINet). (With the release of the February 2003 Software Developer Kit [SDK], the tool formerly abbreviated WinInet is now named WinINet.) This information is designed to help you select the correct technology to use when your application requires Internet or intranet resources. This article does not cover higher level tools such as the SOAP Toolkit, Microsoft XML Core Services (MSXML) objects, Web services proxies in managed code, or client-side Active Template Library (ATL) Server classes such as CAtlHttpClientT and CSoapSocketClientT. When you must have more control than the APIs in this "Summary" section provide, you can use socket APIs.

MORE INFORMATION

  • Affected components should use WinHTTP. WinHTTP is supported in the context of a system service. Another solution is to use System.Net classes or sockets directly. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

    238425 WinInet Not Supported for Use in Services

  • If yours is a new unmanaged Microsoft Win32-based project in Microsoft C or in Microsoft C++, use WinHTTP or System.Net classes if the functionality that you must have is available through WinHTTP or through System.Net classes (see the table that follows). If you call managed-code APIs from unmanaged code, you can use the managed-code APIs without rewriting them. If your application is a Microsoft Visual Basic 6.0 application, use the WinHttpRequest COM object.
  • For managed code applications, use the managed code http stack (System.Net.WebRequest classes) if the functionality is available. Note: Other HTTP protocol managed classes are HttpWebRequest\HttpWebResponse and WebClient. For additional information about how to use the classes, click the following article number to view the article in the Microsoft Knowledge Base:

    303436 SAMPLE: Visual C# .NET Networking Classes HTTP Internet Client

The following table shows the solutions and operating systems that Microsoft supports, that Microsoft may support in the future, and that Microsoft does not support.
FunctionalitySystem.Net (managed) classesWinINet APIsWinHTTP 5.1 (Win32 and COM APIs)
HTTP (client)Yes.Yes.Yes.
CacheNo. Microsoft may add this feature in the future versions.Yes.No.
Authentication (Basic, Digest, Negotiate, NTLM)Yes.Yes.Yes.
AutoDialNo. Use remote access APIs.Yes.No. Use remote access APIs.
CookiesNo. Session cookies only.Yes.No. Session cookies only.
FTPNo. You can implement your own protocol handler for FTP. Microsoft may add FTP in future versions.Yes.No.
P3PNo.Yes.No.
Proxy: Includes dynamic proxy Web Proxy Auto-Discovery (WPAD)No. Static proxy only (Microsoft may add dynamic proxy to future versions).Yes.Yes.
SSLYes.Yes.Yes.
GopherNo.Yes.No.
Support ServicesYes.No.Yes.
New featuresYes. Microsoft may add new features.No. Microsoft does not plan to add new features.Yes. Microsoft may add new HTTP-specific features.
Operating systems supportedMicrosoft Windows 98, Microsoft Windows Millennium Edition (Windows Me), Microsoft Windows NT Server 4.0, Microsoft Windows 2000 operating system and Windows 2000 service packs, Microsoft Windows XP operating system and Windows XP service packs, Microsoft Windows Server 2003 and future releases.Windows 9x, Windows Me, Windows NT Server 4.0, Windows 2000 operating system and Windows 2000 service packs, Windows XP operating system and Windows XP service packs, Windows Server 2003 and future releases.Windows 2000 with Service Pack 3 and later, Windows XP with Service Pack 1 and later, Windows Server 2003 and future releases.
Note For more information about FTP user samples, visit the following Microsoft Web site: http://www.gotdotnet.com/Community/UserSamples/Default.aspx?query=FTP

REFERENCES

For more information about WinHTTP, visit the following Microsoft Developer Network Web site:For additional information about WinINet, visit the following Microsoft Developer Network Web site:For additional information about classes available in the Microsoft .NET Framework to access the Internet, visit the following Microsoft Developer Web site:For additional information about Windows Sockets APIs, visit the following Microsoft Developer Web site:

Modification Type:MinorLast Reviewed:8/26/2005
Keywords:kbWinsock kbhttp kbAPI kbweb kbinfo KB821876 kbAudDeveloper