XMLHttpRequestResponseType - Web APIs 编辑

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 This API has not been standardized.
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 This API has not been standardized.

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

SpecificationStatusComment
XMLHttpRequestUnknownLive standard, latest version

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:82 次

字数:5123

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文