HTTP 206 Partial Content
成功状态响应代码表示请求已成功,并且主体包含所请求的数据区间,该数据区间是在请求的 Range
首部指定的。
如果只包含一个数据区间,那么整个响应的 Content-Type
首部的值为所请求的文件的类型,同时包含 Content-Range
首部。
如果包含多个数据区间,那么整个响应的 Content-Type
首部的值为 multipart/byteranges
,其中一个片段对应一个数据区间,并提供 Content-Range
和 Content-Type
描述信息。
状态
- 206 Partial Content
示例
只包含一个数据区间的响应:
- HTTP/1.1 206 Partial Content
- Date: Wed, 15 Nov 2015 06:25:24 GMT
- Last-Modified: Wed, 15 Nov 2015 04:58:08 GMT
- Content-Range: bytes 21010-47021/47022
- Content-Length: 26012
- Content-Type: image/gif
- ... 26012 bytes of partial image data ...
包含多个数据区间的响应:
- HTTP/1.1 206 Partial Content
- Date: Wed, 15 Nov 2015 06:25:24 GMT
- Last-Modified: Wed, 15 Nov 2015 04:58:08 GMT
- Content-Length: 1741
- Content-Type: multipart/byteranges; boundary=String_separator
- --String_separator
- Content-Type: application/pdf
- Content-Range: bytes 234-639/8000
- ...the first range...
- --String_separator
- Content-Type: application/pdf
- Content-Range: bytes 4590-7999/8000
- ...the second range
- --String_separator--
规范
Specification | Title |
---|---|
RFC 7233, section 4.1: 206 Partial Content | Hypertext Transfer Protocol (HTTP/1.1): Range Requests |
浏览器兼容性
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.
Update compatibility data on GitHub
Desktop | Mobile | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | Safari on iOS | Samsung Internet | |
206 | ChromeFull support Yes | EdgeFull support Yes | FirefoxFull support Yes | IEFull support Yes | OperaFull support Yes | SafariFull support Yes | WebView AndroidFull support Yes | Chrome AndroidFull support Yes | Edge MobileFull support Yes | Firefox AndroidFull support Yes | Opera AndroidFull support Yes | Safari iOSFull support Yes | Samsung Internet AndroidFull support Yes |
Legend
- Full support
- Full support
参见
文档标签和贡献者
标签:
此页面的贡献者:mdnwebdocs-bot, WayneCui, xgqfrms-GitHub
最后编辑者:mdnwebdocs-bot,