Partager via


getAllResponseHeaders Method (ServerXMLHTTP-IServerXMLHTTPRequest)

 

Retrieves the values of all the HTTP headers.

JScript Syntax

strValue = oServerXMLHTTPRequest.getAllResponseHeaders();  

Example

var xmlServerHttp = new ActiveXObject("Msxml2.ServerXMLHTTP.6.0");  
xmlServerHttp.open("GET", "https://localhost/sample.xml", false);  
xmlServerHttp.send();  
WScript.Echo(xmlServerHttp.getAllResponseHeaders());  

Output

This example returns the resulting page header information that was returned by the Web (HTTP) server hosting the specified page (sample.xml). For example, your output should include the following type header field information:

Server: Microsoft-IIS/5.1  
Connection: keep-alive  
Date: Mon, 09 Jun 2003 18:20:29 GMT  
Content-Type: text/xml  
Accept-Ranges: bytes  
Last Modified: Fri, 06 Jun 2003 12:11:56 GMT  
ETag:"1033b5d2242cc31:97c"  
Content-Length: 4550  

C/C++ Syntax

HRESULT getAllResponseHeaders(BSTR *pbstrHeaders);  

Parameters

pbstrHeaders[out, retval]
The resulting header information.

Return Values

S_OK
The value returned if successful.

Remarks

Each header name/value pair is separated by a combination carriage return–line feed character (vbCrLf in Microsoft® Visual Basic®).

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

Versioning

Implemented in: MSXML 3.0 and MSXML 6.0

Applies to

IServerXMLHTTPRequest-ServerXMLHTTP

See Also

send Method (ServerXMLHTTP-IServerXMLHTTPRequest)
getResponseHeader Method (ServerXMLHTTP-IServerXMLHTTPRequest)
setRequestHeader Method (ServerXMLHTTP-IServerXMLHTTPRequest)