HTTP 206 Partial Content 成功狀態碼表明請求成功,且主體包含在請求標頭Range 中所指定的資料區間。

若只包含一個區間,則整個回應的 Content-Type 將會被設為該文件的類型 ,且會包含一個 Content-Range 標頭。

若有多個區間,則整個回應的 Content-Type 會被設為 multipart/byteranges ,且每個分段會對應一個區間,並有 Content-RangeContent-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

瀏覽器相容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
206Chrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support

參見

文件標籤與貢獻者

此頁面的貢獻者: Fu_revwigs
最近更新: Fu_revwigs,