Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IXMLHTTPRequest2::GetAllResponseHeaders method

Retrieves the values of all the HTTP response headers.

Syntax


HRESULT GetAllResponseHeaders(
  [out] WCHAR **ppwszHeaders
);

Parameters

ppwszHeaders [out]

The returned header information. Free the memory used for this parameter using the CoTaskMemFree method.

Return value

Returns S_OK on success.

Remarks

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

The returned response header information is only valid after the OnHeadersAvailable callback method has been called.

Examples


HRESULT hr = S_OK;
WCHAR *pwszHeaderValue = NULL;
IXMLHTTPRequest2 *pIXMLHTTPRequest2 = NULL;

// Create IXMLHTTPRequest2 object and initialize pIXMLHTTPRequest2.
hr = pIXMLHTTPRequest2->GetAllResponseHeaders(&pwszHeaderValue);
if(SUCCEEDED(hr))
{
  MessageBox(NULL, pwszHeaderValue, L"All Response Headers", MB_OK);
}

if (pwszHeaderValue != NULL)
{
      CoTaskMemFree(pwszHeaderValue);
      pwszHeaderValue = NULL;
}

// Release pIXMLHTTPRequest2 when finished with it.


Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Version

MSXML 6.0 and later

Header

Msxml6.h

IDL

Msxml6.idl

See also

IXMLHTTPRequest2
OnHeadersAvailable
CoTaskMemFree

 

 

Community Additions

Show:
© 2017 Microsoft