IXMLHTTPRequest2Callback::OnHeadersAvailable method (msxml6.h)

Occurs after an HTTP request has been sent to the server and the server has responded with response headers.

Syntax

HRESULT OnHeadersAvailable(
  [in, optional] IXMLHTTPRequest2 *pXHR,
  [in]           DWORD            dwStatus,
  [in]           const WCHAR      *pwszStatus
);

Parameters

[in, optional] pXHR

The initial HTTP request object that returns the headers.

[in] dwStatus

The status code for the request.

Note  Possible values for this parameter also include the HTTP_STATUS_* values defined by winhttp.h for desktop apps.
 

[in] pwszStatus

The status code for the request appearing in human-readable form as a null-terminated string.

Return value

Returns S_OK on success.

Note  This callback function must not throw exceptions.
 

Remarks

To view an individual response header, call the GetResponseHeader method on the IXMLHTTPRequest2 interface. To view all response headers, call the GetAllResponseHeaders method. To cancel the request, call the Abort method On the pXHR object.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps],MSXML 6.0 and later
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header msxml6.h

See also

GetAllResponseHeaders Method

GetResponseHeader Method

IXMLHTTPRequest2

IXMLHTTPRequest2Callback

OnHeadersAvailable