IWinHttpRequest interface

The IWinHttpRequest interface provides all of the nonevent methods for Microsoft Windows HTTP Services (WinHTTP).

Members

The IWinHttpRequest interface inherits from the IUnknown interface. IWinHttpRequest also has these types of members:

Methods

The IWinHttpRequest interface has these methods.

Method Description
Abort Aborts a WinHTTP Send method.
GetAllResponseHeaders Retrieves all HTTP response headers.
GetResponseHeader Retrieves the HTTP response headers.
Open Opens an HTTP connection to an HTTP resource.
Send Sends an HTTP request to an HTTP server.
SetAutoLogonPolicy Sets the current Automatic Logon Policy.
SetClientCertificate Selects a client certificate to send to a Secure Hypertext Transfer Protocol (HTTPS) server.
SetCredentials Sets credentials to be used with an HTTP server, either a proxy server or an originating server.
SetProxy Sets proxy server information.
SetRequestHeader Adds, changes, or deletes an HTTP request header.
SetTimeouts Specifies the individual time-out components of a send/receive operation, in milliseconds.
WaitForResponse Waits for an asynchronous Send method to complete, with optional time-out value, in seconds.

Properties

The IWinHttpRequest interface has these properties.

Property Access type Description
Option
Read/write
A WinHTTP option value.
ResponseBody
Read-only
The response entity body as an array of unsigned bytes.
ResponseStream
Read-only
The response entity body as an IStream.
ResponseText
Read-only
The response entity body.
Status
Read-only
The HTTP status code from the last response.
StatusText
Read-only
The HTTP status text.

Remarks

The IWinHttpRequest interface defined in httprequest.idl is implemented by a class with id of CLSID_WinHttpRequest. An application obtain this interface by calling CoCreateInstance with a class id of CLSID_WinHttpRequest and an interface id of IID_IWinHttpRequest.

Note

For Windows XP and Windows 2000, see the Run-Time Requirements section of the WinHttp start page.

Requirements

Requirement Value
Minimum supported client
Windows XP, Windows 2000 Professional with SP3 [desktop apps only]
Minimum supported server
Windows Server 2003, Windows 2000 Server with SP3 [desktop apps only]
Redistributable
WinHTTP 5.0 and Internet Explorer 5.01 or later on Windows XP and Windows 2000.
IDL
HttpRequest.idl
Library
Winhttp.lib
DLL
Winhttp.dll

See also

IWinHttpRequestEvents

WinHTTP Versions