Export (0) Print
Expand All

WinHttpRequest object

This topic provides information about using the WinHTTP WinHttpRequest COM object with scripting languages.

Members

The WinHttpRequest object has these types of members:

Events

The WinHttpRequest object has these events.

EventDescription
OnError

Occurs when there is a run-time error in the application.

OnResponseDataAvailable

Occurs when data is available from the response.

OnResponseFinished

Occurs when the response data is complete.

OnResponseStart

Occurs when the response data starts to be received.

 

Methods

The WinHttpRequest object has these methods.

MethodDescription
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 an origin or a proxy server.

SetProxy

Sets proxy server information.

SetRequestHeader

Adds, changes, or deletes an HTTP request header.

SetTimeouts

Specifies, in milliseconds, the individual time-out components of a send/receive operation.

WaitForResponse

Specifies the wait time, in seconds, for an asynchronous Send method to complete, with optional time-out value.

 

Properties

The WinHttpRequest object has these properties.

PropertyAccess typeDescription

Option

Read/write

Sets or retrieves a WinHTTP option value.

ResponseBody

Read-only

Retrieves the response entity body as an array of unsigned bytes.

ResponseStream

Read-only

Retrieves the response entity body as an IStream.

ResponseText

Read-only

Retrieves the response entity body as text.

Status

Read-only

Retrieves the HTTP status code from the last response.

StatusText

Read-only

Retrieves HTTP status text.

 

Remarks

The WinHttpRequest object uses the IErrorInfo interface to provide error data. A description and numerical error value can be obtained with the Err object in Microsoft Visual Basic Scripting Edition (VBScript), and the Error object in Microsoft JScript. The lower 16 bits of an error number correspond to the values found in Error Messages.

Note  For Windows XP and Windows 2000, see Run-Time Requirements.

Requirements

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

WinHTTP Versions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft