HTTP 206 Partial Content 成功状态响应代码表示请求已成功,并且主体包含所请求的数据区间,该数据区间是在请求的 Range 首部指定的。

如果只包含一个数据区间,那么整个响应的 Content-Type 首部的值为所请求的文件的类型,同时包含 Content-Range 首部。

如果包含多个数据区间,那么整个响应的 Content-Type 首部的值为 multipart/byteranges ,其中一个片段对应一个数据区间,并提供 Content-RangeContent-Type 描述信息。

状态

  1. 206 Partial Content

示例

只包含一个数据区间的响应:

  1. HTTP/1.1 206 Partial Content
  2. Date: Wed, 15 Nov 2015 06:25:24 GMT
  3. Last-Modified: Wed, 15 Nov 2015 04:58:08 GMT
  4. Content-Range: bytes 21010-47021/47022
  5. Content-Length: 26012
  6. Content-Type: image/gif
  7.  
  8. ... 26012 bytes of partial image data ...

包含多个数据区间的响应:

  1. HTTP/1.1 206 Partial Content
  2. Date: Wed, 15 Nov 2015 06:25:24 GMT
  3. Last-Modified: Wed, 15 Nov 2015 04:58:08 GMT
  4. Content-Length: 1741
  5. Content-Type: multipart/byteranges; boundary=String_separator
  6.  
  7. --String_separator
  8. Content-Type: application/pdf
  9. Content-Range: bytes 234-639/8000
  10.  
  11. ...the first range...
  12. --String_separator
  13. Content-Type: application/pdf
  14. Content-Range: bytes 4590-7999/8000
  15.  
  16. ...the second range
  17. --String_separator--

规范

SpecificationTitle
RFC 7233, section 4.1: 206 Partial ContentHypertext 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

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
206ChromeFull support YesEdgeFull support YesFirefoxFull support YesIEFull support YesOperaFull support YesSafariFull support YesWebView AndroidFull support YesChrome AndroidFull support YesEdge MobileFull support YesFirefox AndroidFull support YesOpera AndroidFull support YesSafari iOSFull support YesSamsung Internet AndroidFull support Yes

Legend

  • Full support
  • Full support

参见

文档标签和贡献者

标签:

此页面的贡献者:mdnwebdocs-bot, WayneCui, xgqfrms-GitHub

最后编辑者:mdnwebdocs-bot,