diff options
Diffstat (limited to 'files/zh-cn/web/http/headers/content-range/index.html')
-rw-r--r-- | files/zh-cn/web/http/headers/content-range/index.html | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/files/zh-cn/web/http/headers/content-range/index.html b/files/zh-cn/web/http/headers/content-range/index.html new file mode 100644 index 0000000000..7ec65749f4 --- /dev/null +++ b/files/zh-cn/web/http/headers/content-range/index.html @@ -0,0 +1,87 @@ +--- +title: Content-Range +slug: Web/HTTP/Headers/Content-Range +tags: + - 响应首部 + - 超文本传输协议 + - 首部 +translation_of: Web/HTTP/Headers/Content-Range +--- +<div>{{HTTPSidebar}}</div> + +<p>在HTTP协议中,响应首部 <strong><code>Content-Range</code></strong> 显示的是一个数据片段在整个文件中的位置。</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">Header type</th> + <td>{{Glossary("Response header")}}</td> + </tr> + <tr> + <th scope="row">{{Glossary("Forbidden header name")}}</th> + <td>no</td> + </tr> + <tr> + <th scope="row">{{Glossary("Simple response header", "CORS-safelisted response-header")}}</th> + <td>no</td> + </tr> + </tbody> +</table> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox">Content-Range: <unit> <range-start>-<range-end>/<size> +Content-Range: <unit> <range-start>-<range-end>/* +Content-Range: <unit> */<size></pre> + +<h2 id="指令">指令</h2> + +<dl> + <dt><unit></dt> + <dd>数据区间所采用的单位。通常是字节(byte)。</dd> +</dl> + +<dl> + <dt><range-start></dt> + <dd>一个整数,表示在给定单位下,区间的起始值。</dd> + <dt><range-end></dt> + <dd>一个整数,表示在给定单位下,区间的结束值。</dd> + <dt><size></dt> + <dd>整个文件的大小(如果大小未知则用"*"表示)。</dd> +</dl> + +<h2 id="示例">示例</h2> + +<pre>Content-Range: bytes 200-1000/67589 +</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", "Content-Range", "4.2")}}</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.headers.Content-Range")}}</p> + +<h2 id="相关内容">相关内容</h2> + +<ul> + <li>{{HTTPHeader("If-Range")}}</li> + <li>{{HTTPHeader("Range")}}</li> + <li>{{HTTPHeader("Content-Type")}}</li> + <li>{{HTTPStatus("206")}} <code>Partial Content</code></li> + <li>{{HTTPStatus("416")}} <code>Range Not Satisfiable</code></li> +</ul> |