IXMLHTTPRequest2Callback::OnHeadersAvailable method (msxml6.h)

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


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


[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.


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.


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