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
responseTypestring is treated the same as"text", the default type. arraybuffer- The
responseis a JavaScriptArrayBuffercontaining binary data. blob- The
responseis aBlobobject containing the binary data. document- The
responseis an HTMLDocumentor XMLXMLDocument, 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
responseis a JavaScript object created by parsing the contents of received data as JSON. text- The
responseis a text in aDOMStringobject. ms-stream- The
responseis 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
XMLHttpRequestto deliverArrayBufferobjects containing chunks of the incoming data. Accessingresponseduring aprogressevent returns the data received so far. Outside theprogressevent handler, the value ofresponseis alwaysnull. 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
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
responseType | Chrome Full support 31 | Edge Full support 12 | Firefox Full support 6 | IE Full support 10 | Opera Full support 18 | Safari Full support 7 | WebView Android Full support 55 | Chrome Android Full support 55 | Firefox Android Full support 50 | Opera Android Full support 42 | Safari iOS Full support 7 | Samsung Internet Android Full support 6.0 |
arraybuffer | Chrome Full support 31 | Edge Full support 12 | Firefox Full support 6 | IE Full support 10 | Opera Full support 18 | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 50 | Opera Android Full support Yes | Safari iOS ? | Samsung Internet Android Full support Yes |
blob | Chrome Full support 31 | Edge Full support 12 | Firefox Full support 6 | IE Full support 10 | Opera Full support 18 | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 50 | Opera Android Full support Yes | Safari iOS ? | Samsung Internet Android Full support Yes |
document | Chrome Full support 31 | Edge Full support 12 | Firefox Full support 11 | IE Full support 10 | Opera No support No | Safari Full support 7 | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 50 | Opera Android Full support Yes | Safari iOS ? | Samsung Internet Android Full support Yes |
json | Chrome Full support 31 | Edge Full support 79 | Firefox Full support 10 | IE No support No | Opera Full support 18 | Safari Full support 7 | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 50 | Opera Android ? | Safari iOS ? | Samsung Internet Android Full support Yes |
moz-blob | Chrome No support No | Edge No support No | Firefox No support 12 — 58 | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android No support No | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
moz-chunked-arraybuffer | Chrome No support No | Edge No support No | Firefox No support 14 — 68 | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android No support 50 — 68 | Opera Android No support No | Safari iOS No support No | Samsung 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.
