blob: 10319c5b55721d40025621c135263ab5da0a4a10 (
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
|
---
title: 411 Length Required
slug: Web/HTTP/Status/411
tags:
- 分块传输
- 客户端错误
- 状态码
translation_of: Web/HTTP/Status/411
---
<div>{{HTTPSidebar}}</div>
<p>响应状态码 <code><strong>411</strong></code><strong><code> Length Required</code></strong> 属于客户端错误,表示由于缺少确定的{{HTTPHeader("Content-Length")}} 首部字段,服务器拒绝客户端的请求。</p>
<p>注意,按照规范,当使用分块模式传输数据的时候, <code>Content-Length</code> 首部是不存在的,但是需要在每一个分块的开始添加该分块的长度,用十六进制数字表示。参见 {{HTTPHeader("Transfer-Encoding")}} 获取更多细节信息。</p>
<h2 id="状态">状态</h2>
<pre class="syntaxbox">411 Length Required</pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Title</th>
</tr>
<tr>
<td>{{RFC("7231", "411 Length Required" , "6.5.10")}}</td>
<td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td>
</tr>
</tbody>
</table>
<h2 id="相关内容">相关内容</h2>
<ul>
<li>{{HTTPHeader("Content-Length")}}</li>
<li>{{HTTPHeader("Transfer-Encoding")}}</li>
</ul>
|