Microsoft XML 2.5 SDK


 

IXMLHttpRequest::getAllResponseHeaders Method

[This is preliminary documentation and subject to change.]

Retrieves the values of all the HTTP headers.

Visual Basic Syntax

strValue = oXMLHttpRequest.getAllResponseHeaders

C/C++ Syntax

HRESULT getAllResponseHeaders(

    BSTR *pbstrHeaders);

Parameters

pbstrHeaders

[out]
Resulting header information.

C/C++ Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

Each header name/value pair is separated by a combination carriage return-linefeed character (vbCrLf in Visual Basic).

The results of this method are valid only after the send method has been successfully completed.

C/C++ Example

HRESULT hr;
BSTR bstrValue = NULL;
IXMLHttpRequest *pIXMLHttpRequest = NULL;

try
{
   // create XMLHttpRequest object and initialize pIXMLHttpRequest
   hr = pIXMLHttpRequest->getAllResponseHeaders(&bstrValue);
   if(SUCCEEDED(hr))
      ::MessageBox(NULL, bstrValue, _T("All Response Headers"), MB_OK);   
}
catch(...)
{
   DisplayErrorToUser();
}
// Release pIXMLHttpRequest when done with it.

See Also

getResponseHeader, setRequestHeader