responseText
ResponseText is a property of the XMLHttpRequest interface used in web browsers to expose the server’s response data as plain text. When a request completes successfully, responseText contains the response body interpreted as a string. It is commonly used for textual responses such as HTML, plain text, or XML, and is often contrasted with binary-oriented approaches or with higher-level APIs that automatically parse formats like JSON.
Access to responseText occurs after the load event, once the data has been received. If the response
In practice, responseText is frequently used to manually parse responses, for example to extract data from
Compatibility and evolution: responseText has been part of the traditional XMLHttpRequest API for many years and
See also: XMLHttpRequest, response, responseXML, responseType, Fetch API, JSON.parse.