responseText Property (ServerXMLHTTP/IServerXMLHTTPRequest)

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - DOM Reference

responseText Property (ServerXMLHTTP/IServerXMLHTTPRequest)

Represents the response entity body as a string.

[Script]

Script Syntax

strValue = oServerXMLHTTPRequest.responseText;

Example

var xmlServerHttp = new ActiveXObject("Msxml2.ServerXMLHTTP.5.0");
xmlServerHttp.open("GET", "http://localhost/sample.xml", false);
xmlServerHttp.send();
alert(xmlServerHttp.responseText);
[Visual Basic]

Visual Basic Syntax

strValue = oServerXMLHTTPRequest.responseText

Example

Dim xmlServerHttp As New Msxml2.ServerXMLHTTP50
xmlServerHttp.open "GET", "http://localhost/sample.xml", False
xmlServerHttp.send
MsgBox xmlServerHttp.responseText
[C/C++]

C/C++ Syntax

HRESULT get_responseText(VARIANT* pvarVal);

Parameters

pvarVal [out, retval]
The response entity body as a string.

C/C++ Return Values

S_OK
The value returned if successful.
E_PENDING
The value returned if the data is unavailable.

Remarks

ServerXMLHTTP/IServerXMLHTTPRequest tries to decode the response into a Unicode string. It assumes the default encoding is UTF-8, but it can decode any type of UCS-2 (big or little endian) or UCS-4 encoding as long as the server sends the appropriate Unicode byte-order mark. It does not process the <? XML coding declaration. If you know the response is going to be XML, use the responseXML property for full XML encoding support.

This property represents only one of several forms in which the HTTP response can be returned.

To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

responseBody Property | responseStream Property | responseXML Property

Applies to: ServerXMLHTTP/IServerXMLHTTPRequest