XMLHttpRequestResponseType

You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!

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

""
An empty responseType string is treated the same as "text", the default type.
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 a text in a DOMString object.
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.

Deprecated values

moz-chunked-arraybuffer

A Firefox-only value which instructs XMLHttpRequest to deliver ArrayBuffer objects containing chunks of the incoming data. Accessing response during a progress event returns the data received so far. Outside the progress event handler, the value of response is always null. You shouldn't use this non-standard (and, as of Firefox 68, entirely removed) API; instead, consider using the Fetch API with readable streams, which offers a standard alternative to accessing the response in a streaming fashion.

Specifications

Specification Status Comment
XMLHttpRequest Unknown Live standard, latest version

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
responseTypeChrome Full support 31Edge Full support 12Firefox Full support 6IE Full support 10Opera Full support 18Safari Full support 7WebView Android Full support 55Chrome Android Full support 55Firefox Android Full support 50Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support 6.0
arraybufferChrome Full support 31Edge Full support YesFirefox Full support 6IE Full support 10Opera Full support 18Safari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 50Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
blobChrome Full support 31Edge Full support YesFirefox Full support 6IE Full support 10Opera Full support 18Safari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 50Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
documentChrome Full support 31Edge Full support YesFirefox Full support 11IE Full support 10Opera No support NoSafari Full support 7WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 50Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
jsonChrome Full support 31Edge No support NoFirefox Full support 10IE No support NoOpera Full support 18Safari Full support 7WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 50Opera Android ? Safari iOS ? Samsung Internet Android Full support Yes
moz-blob
DeprecatedNon-standard
Chrome No support NoEdge No support NoFirefox No support 12 — 58IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
moz-chunked-arraybuffer
DeprecatedNon-standard
Chrome No support NoEdge No support NoFirefox No support 14 — 68IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android No support 50 — 68Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.

See also