diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/http/status/206 | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/http/status/206')
-rw-r--r-- | files/zh-cn/web/http/status/206/index.html | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/files/zh-cn/web/http/status/206/index.html b/files/zh-cn/web/http/status/206/index.html new file mode 100644 index 0000000000..59458a983a --- /dev/null +++ b/files/zh-cn/web/http/status/206/index.html @@ -0,0 +1,82 @@ +--- +title: 206 Partial Content +slug: Web/HTTP/Status/206 +tags: + - 206 Partial Content + - 范围请求 +translation_of: Web/HTTP/Status/206 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <strong><code>206 Partial Content</code></strong> 成功状态响应代码表示请求已成功,并且主体包含所请求的数据区间,该数据区间是在请求的 {{HTTPHeader("Range")}} 首部指定的。</p> + +<p>如果只包含一个数据区间,那么整个响应的 {{HTTPHeader("Content-Type")}} 首部的值为所请求的文件的类型,同时包含 {{HTTPHeader("Content-Range")}} 首部。</p> + +<p>如果包含多个数据区间,那么整个响应的 {{HTTPHeader("Content-Type")}} 首部的值为 <code>multipart/byteranges</code> ,其中一个片段对应一个数据区间,并提供 {{HTTPHeader("Content-Range")}} 和 {{HTTPHeader("Content-Type")}} 描述信息。</p> + +<h2 id="状态">状态</h2> + +<pre class="syntaxbox">206 Partial Content</pre> + +<h2 id="示例">示例</h2> + +<p>只包含一个数据区间的响应:</p> + +<pre class="newpage">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 ...</pre> + +<p>包含多个数据区间的响应:</p> + +<pre class="newpage">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--</pre> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Title</th> + </tr> + <tr> + <td>{{RFC("7233", "206 Partial Content" , "4.1")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Range Requests</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("http.status.206")}}</p> + +<h2 id="参见">参见</h2> + +<ul> + <li>{{HTTPHeader("If-Range")}}</li> + <li>{{HTTPHeader("Range")}}</li> + <li>{{HTTPHeader("Content-Range")}}</li> + <li>{{HTTPHeader("Content-Type")}}</li> +</ul> |