IXMLHTTPRequest2Callback::OnHeadersAvailable method

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

Syntax

HRESULT OnHeadersAvailable(
  IXMLHTTPRequest2 *pXHR,
  DWORD            dwStatus,
  const WCHAR      *pwszStatus
);

Parameters

pXHR

The initial HTTP request object that returns the headers.

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.
 

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

   
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