aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/http/headers/content-length/index.html
blob: b34d7b78ce639a2255746b2393f68d3be84cae70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
title: Content-Length
slug: Web/HTTP/Headers/Content-Length
tags:
  - 超文本传输协议
  - 首部
translation_of: Web/HTTP/Headers/Content-Length
---
<div>{{HTTPSidebar}}</div>

<p><strong><code>Content-Length</code></strong> 是一个实体消息首部,用来指明发送给接收方的消息主体的大小,即用十进制数字表示的八位元组的数目。</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Header type</th>
   <td>{{Glossary("Entity header")}}</td>
  </tr>
  <tr>
   <th scope="row">{{Glossary("Forbidden header name")}}</th>
   <td>yes</td>
  </tr>
 </tbody>
</table>

<h2 id="语法">语法</h2>

<pre class="syntaxbox">Content-Length: &lt;length&gt;
</pre>

<h2 id="指令">指令</h2>

<dl>
 <dt>&lt;length&gt;</dt>
 <dd>消息的长度,用十进制数字表示的八位字节的数目。</dd>
</dl>

<h2 id="规范">规范</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Title</th>
  </tr>
  <tr>
   <td>{{RFC("7230", "Content-Length", "3.3.2")}}</td>
   <td>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

<p>{{Compat("http.headers.Content-Length")}}</p>

<h2 id="相关内容">相关内容</h2>

<ul>
 <li>{{HTTPHeader("Transfer-Encoding")}}</li>
</ul>