GetAllResponseHeaders Method (IXMLHTTPRequest2, Windows 8)

 

Retrieves the values of all the HTTP headers.

HRESULT GetAllResponseHeaders(WCHAR **ppwszHeaders);  

Parameters

ppwszHeaders[out, string]
The HTTP response headers for the request. You must free this parameter using the CoTaskMemFree method.

Return Values

S_OK
The value returned if successful.

Example

HRESULT hr;  
WCHAR **pwszValue = NULL;  
IXMLHttpRequest2 *pIXMLHttpRequest2 = NULL;  
  
// Create IXMLHttpRequest2 object and initialize pIXMLHttpRequest2.  
hr = pIXMLHttpRequest2->getAllResponseHeaders(&ppwszHeaders);  
if(SUCCEEDED(hr))  
   ::MessageBox(NULL, **pwszValue, _T("All Response Headers"), MB_OK);  
  
// Release pIXMLHttpRequest2 when finished with it.  

Each header name/value pair is separated by a combination carriage return-line feed.

The results of this method are valid only after the OnHeadersAvailable callback has been executed.

Implemented in: MSXML 6.0

IXMLHTTPRequest2 (Windows 8)

Send Method (IXMLHTTPRequest2, Windows 8)
GetResponseHeader Method (IXMLHTTPRequest2, Windows 8)
setRequestHeader Method (IXMLHTTPRequest)
CoTaskMemFree Function
OnHeadersAvailable Event (Windows 8)

Show: