responseText Property (IXMLHTTPRequest)
Represents the response entity body as a string.
Script Syntax
strValue = oXMLHttpRequest.responseText;
Example
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.5.0"); xmlhttp.open("GET", "http://localhost/sample.xml", false); xmlhttp.send(); alert(xmlhttp.responseText);
Visual Basic Syntax
strValue = oXMLHttpRequest.responseText
Example
Dim xmlhttp As New Msxml2.XMLHTTP50 xmlhttp.open "GET", "http://localhost/sample.xml", False xmlhttp.send MsgBox xmlhttp.responseText
C/C++ Syntax
HRESULT get_responseText(BSTR* pbstrBody);
Parameters
- pbstrBody [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
Variant. The property is read-only. This property represents only one of several forms in which the HTTP response can be returned.
IXMLHTTP
attempts to decode the response into a Unicode string. It assumes the default encoding is UTF-8, but 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.
To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button in the upper-left corner of the page.
See Also
responseBody Property | responseStream Property | responseXML Property
Applies to: IXMLHTTPRequest