Rediger

Del via


Choosing a WinHTTP Interface

Before you begin to develop a Microsoft Windows HTTP Services (WinHTTP) application, you must first decide whether to use the C/C++ API or the COM interface. The following table summarizes the advantages and disadvantages associated with each of these approaches.

Advantage or disadvantage C/C++ API COM interface
Advantages
  • Responses can be processed in chunks, which is more efficient.
  • POST operations can also be processed in chunks, speeding processing time.
  • AutoProxy support.
  • Access to the full feature set of WinHTTP.
  • Binary data can easily be handled.
  • Creating an application is easy and requires fewer lines of code than the C/C++ API.
  • The interface can be used by scripting languages.
Disadvantages
  • Processing is more complex.
  • The C/C++ API requires more steps than the COM interface to perform the same actions.
  • Setting up a request takes more code.
  • The COM interface does not provide access to the full feature set of WinHTTP.
  • It is difficult to handle binary data types in some scripting languages, such as VBScript and JScript.
  • The COM interface does not support AutoProxy.
  • Applications must use the COM APARTMENT_THREADED model.
  • Before a response can begin being processed, the entire response must first be received and buffered.