W3cubDocs

/DOM

XMLHttpRequestResponseType

The XMLHttpRequestResponseType type is an enumerated set of strings which are used to specify the type of data contained in the response of an XMLHttpRequest. These values are used when getting or setting the responseType on the request.

Values

Value Description
"" An empty responseType string is treated the same as "text", the default type (therefore, as a DOMString.
"arraybuffer" The response is a JavaScript ArrayBuffer containing binary data.
"blob" The response is a Blob object containing the binary data.
"document" The response is an HTML Document or XML XMLDocument, as appropriate based on the MIME type of the received data. See HTML in XMLHttpRequest to learn more about using XHR to fetch HTML content.
"json" The response is a JavaScript object created by parsing the contents of received data as JSON.
"text" The response is text in a DOMString object.
"moz-chunked-arraybuffer"

Similar to "arraybuffer", but the data is received in a stream. When using this response type, the value in response is only available in the handler for the progress event, and only contains the data received since the last progress event, rather than the cumulative data received since the request was sent.

Accessing response during a progress event returns the data received so far. Outside the progress event handler, the value of response is always null.

"ms-stream" The response is part of a streaming download; this response type is only allowed for download requests, and is only supported by Internet Explorer.

Specifications

Specification Status Comment
XMLHttpRequest Unknown Live standard, latest version

Browser compatibility

No compatibility data found. Please contribute data for "api.XMLHttpRequestResponseType" (depth: 1) to the MDN compatibility data repository.

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequestResponseType