Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoCorrect files/zh-cn/web/http/status/**/* #5880

Merged
merged 2 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions files/zh-cn/web/http/status/100/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
---
<div>{{HTTPSidebar}}</div>

<p>HTTP <strong><code>100 Continue</code></strong> 信息型状态响应码表示目前为止一切正常, 客户端应该继续请求, 如果已完成请求则忽略.</p>
<p>HTTP <strong><code>100 Continue</code></strong> 信息型状态响应码表示目前为止一切正常客户端应该继续请求如果已完成请求则忽略</p>

<p>为了让服务器检查请求的首部, 客户端必须在发送请求实体前, 在初始化请求中发送 <code>Expect: 100-continue</code> 首部并接收 <code>100 Continue</code> 响应状态码.</p>
<p>为了让服务器检查请求的首部客户端必须在发送请求实体前在初始化请求中发送 <code>Expect: 100-continue</code> 首部并接收 <code>100 Continue</code> 响应状态码</p>

<h2 id="状态码">状态码</h2>

Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/http/status/101/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<p>HTTP  <code><strong>101 Switching Protocol</strong></code>(协议切换)状态码表示服务器应客户端升级协议的请求({{HTTPHeader("Upgrade")}}请求头)正在切换协议。</p>

<p>服务器会发送一个{{HTTPHeader("Upgrade")}}响应头来表明其正在切换过去的协议。<br>
该过程在协议升级机制(<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism">Protocol upgrade mechanism</a>)中详细描述。</p>
该过程在协议升级机制<a href="/zh-CN/docs/Web/HTTP/Protocol_upgrade_mechanism">Protocol upgrade mechanism</a>中详细描述。</p>

<h2 id="状态">状态</h2>

Expand Down
6 changes: 3 additions & 3 deletions files/zh-cn/web/http/status/200/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
---
<div>{{HTTPSidebar}}</div>

<p>状态码 <strong><code>200 OK</code></strong> 表明请求已经成功. 默认情况下状态码为200的响应可以被缓存。</p>
<p>状态码 <strong><code>200 OK</code></strong> 表明请求已经成功。默认情况下状态码为 200 的响应可以被缓存。</p>

<p>不同请求方式对于请求成功的意义如下:</p>
<p>不同请求方式对于请求成功的意义如下</p>

<ul>
<li>{{HTTPMethod("GET")}}: 已经取得资源,并将资源添加到响应的消息体中。</li>
Expand All @@ -20,7 +20,7 @@
<li>{{HTTPMethod("TRACE")}}: 响应的消息体中包含服务器接收到的请求信息。</li>
</ul>

<p>{{HTTPMethod("PUT")}} 和 {{HTTPMethod("DELETE")}} 的请求成功通常并不是响应<code>200</code> <code>OK</code>的状态码而是 {{HTTPStatus("204")}} <code>No Content</code> 表示无内容(或者  {{HTTPStatus("201")}}  <code>Created</code>表示一个资源首次被创建成功)。</p>
<p>{{HTTPMethod("PUT")}} 和 {{HTTPMethod("DELETE")}} 的请求成功通常并不是响应<code>200</code> <code>OK</code>的状态码而是 {{HTTPStatus("204")}} <code>No Content</code> 表示无内容或者 {{HTTPStatus("201")}} <code>Created</code>表示一个资源首次被创建成功。</p>

<h2 id="状态码">状态码</h2>

Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/http/status/201/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
---
<div>{{HTTPSidebar}}</div>

<p>在HTTP协议中,<strong><code>201 Created</code></strong> 是一个代表成功的应答状态码,表示请求已经被成功处理,并且创建了新的资源。新的资源在应答返回之前已经被创建。同时新增的资源会在应答消息体中返回,其地址或者是原始请求的路径,或者是 {{HTTPHeader("Location")}} 首部的值。</p>
<p>在 HTTP 协议中,<strong><code>201 Created</code></strong> 是一个代表成功的应答状态码,表示请求已经被成功处理,并且创建了新的资源。新的资源在应答返回之前已经被创建。同时新增的资源会在应答消息体中返回,其地址或者是原始请求的路径,或者是 {{HTTPHeader("Location")}} 首部的值。</p>

<p>这个状态码的常规使用场景是作为 {{HTTPMethod("POST")}} 请求的返回值。</p>

Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/http/status/203/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
---
<div>{{HTTPSidebar}}</div>

<p>在 HTTP 协议中,响应状态码 <strong><code>203 Non-Authoritative Information</code></strong>  表示请求已经成功被响应,但是获得的负载与源头服务器的状态码为 {{HTTPStatus("200")}} (<code>OK</code>)的响应相比,经过了拥有转换功能的 {{Glossary("Proxy server", "proxy")}} (代理服务器)的修改。</p>
<p>在 HTTP 协议中,响应状态码 <strong><code>203 Non-Authoritative Information</code></strong>  表示请求已经成功被响应,但是获得的负载与源头服务器的状态码为 {{HTTPStatus("200")}} (<code>OK</code>) 的响应相比,经过了拥有转换功能的 {{Glossary("Proxy server", "proxy")}}(代理服务器)的修改。</p>

<p>The <code>203</code> 状态码有点类似于 {{HTTPHeader("Warning")}} 首部的 <code><a href="/en-US/docs/Web/HTTP/Headers/Warning#Warning_codes">214</a></code>(Transformation Applied)警告码,后者的优势在于可以应用于任何状态码的响应之中。</p>

Expand Down
4 changes: 2 additions & 2 deletions files/zh-cn/web/http/status/301/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
---
<div>{{HTTPSidebar}}</div>

<p>HTTP <code><strong>301</strong></code><strong><code> 永久重定向</code></strong> 说明请求的资源已经被移动到了由 {{HTTPHeader("Location")}} 头部指定的url上,是固定的不会再改变。搜索引擎会根据该响应修正。</p>
<p>HTTP <code><strong>301</strong></code><strong><code> 永久重定向</code></strong> 说明请求的资源已经被移动到了由 {{HTTPHeader("Location")}} 头部指定的 url 上,是固定的不会再改变。搜索引擎会根据该响应修正。</p>

<p>尽管标准要求浏览器在收到该响应并进行重定向时不应该修改http method和body,但是有一些浏览器可能会有问题。所以最好是在应对{{HTTPMethod("GET")}} 或 {{HTTPMethod("HEAD")}} 方法时使用301,其他情况使用{{HTTPStatus("308")}} 来替代301。</p>
<p>尽管标准要求浏览器在收到该响应并进行重定向时不应该修改 http method 和 body,但是有一些浏览器可能会有问题。所以最好是在应对{{HTTPMethod("GET")}} 或 {{HTTPMethod("HEAD")}} 方法时使用 301,其他情况使用{{HTTPStatus("308")}} 来替代 301。</p>

<h2 id="状态">状态</h2>

Expand Down
4 changes: 2 additions & 2 deletions files/zh-cn/web/http/status/302/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
---
<div>{{HTTPSidebar}}</div>

<p>HTTP <code><strong>302</strong></code><strong><code> Found</code></strong> 重定向状态码表明请求的资源被暂时的移动到了由该HTTP响应的响应头{{HTTPHeader("Location")}} 指定的 URL 上。浏览器会重定向到这个URL, 但是搜索引擎不会对该资源的链接进行更新 (In SEO-speak, it is said that the link-juice is not sent to the new URL)。</p>
<p>HTTP <code><strong>302 Found</code></strong> 重定向状态码表明请求的资源被暂时的移动到了由该 HTTP 响应的响应头 {{HTTPHeader("Location")}} 指定的 URL 上。浏览器会重定向到这个 URL,但是搜索引擎不会对该资源的链接进行更新 (In SEO-speak, it is said that the link-juice is not sent to the new URL)。</p>

<p>即使规范要求浏览器在重定向时保证请求方法和请求主体不变,但并不是所有的用户代理都会遵循这一点,你依然可以看到有缺陷的软件的存在。所以推荐仅在响应 {{HTTPMethod("GET")}} 或 {{HTTPMethod("HEAD")}} 方法时采用 302 状态码,而在其他时候使用 {{HTTPStatus("307")}} Temporary Redirect 来替代,因为在这些场景下方法变换是明确禁止的。</p>

<p>在确实需要将重定向请求的方法转换为 {{HTTPMethod("GET")}}的场景下,可以使用 {{HTTPStatus("303")}} See Other。例如在使用 {{HTTPMethod("PUT")}} 方法进行文件上传操作时,需要返回确认信息(例如“你已经成功上传了xyz”)而不是上传的资源本身,就可以使用这个状态码。</p>
<p>在确实需要将重定向请求的方法转换为 {{HTTPMethod("GET")}}的场景下,可以使用 {{HTTPStatus("303")}} See Other。例如在使用 {{HTTPMethod("PUT")}} 方法进行文件上传操作时,需要返回确认信息(例如“你已经成功上传了 xyz”)而不是上传的资源本身,就可以使用这个状态码。</p>

<h2 id="状态">状态</h2>

Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/http/status/402/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<p><strong style="font-size: 1rem; letter-spacing: -0.00278rem;"><code>402 Payment Required</code></strong> 是一个被保留使用的非标准客户端错误状态响应码。</p>

<p>有时, 这个状态码表明直到客户端付费之后请求才会被处理。402状态码被创建最初目的是用于数字现金或微型支付系统, 表明客户端请求的内容只有付费之后才能获取。目前还不存在标准的使用约定, 不同的实体可以在不同的环境下使用。</p>
<p>有时, 这个状态码表明直到客户端付费之后请求才会被处理。402 状态码被创建最初目的是用于数字现金或微型支付系统, 表明客户端请求的内容只有付费之后才能获取。目前还不存在标准的使用约定, 不同的实体可以在不同的环境下使用。</p>

<h2 id="状态">状态</h2>

Expand Down
4 changes: 2 additions & 2 deletions files/zh-cn/web/http/status/404/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
---
<div>{{HTTPSidebar}}</div>

<p>状态码 <code><strong>404</strong></code><strong><code> Not Found</code></strong> 代表客户端错误,指的是服务器端无法找到所请求的资源。返回该响应的链接通常称为坏链(broken link)或死链(dead link),它们会导向链接出错处理(<a href="https://en.wikipedia.org/wiki/Link_rot">link rot</a>)页面。</p>
<p>状态码 <code><strong>404</strong></code><strong><code> Not Found</code></strong> 代表客户端错误,指的是服务器端无法找到所请求的资源。返回该响应的链接通常称为坏链(broken link)或死链(dead link),它们会导向链接出错处理 (<a href="https://en.wikipedia.org/wiki/Link_rot">link rot</a>) 页面。</p>

<p>404 状态码并不能说明请求的资源是临时还是永久丢失。如果服务器知道该资源是永久丢失,那么应该返回 {{HTTPStatus(410)}} (Gone) 而不是 404 。</p>

Expand All @@ -24,7 +24,7 @@ <h2 id="自定义错误页面">自定义错误页面</h2>
<p>你可以访问一下 <a href="https://developer.mozilla.org/en-US/404">MDN 的 404 页面</a>获取一些启发。</p>

<div class="note">
<p>自定义的404页面应该是对用户友好且可读性高的,不能使用户产生困惑。</p>
<p>自定义的 404 页面应该是对用户友好且可读性高的,不能使用户产生困惑。</p>
</div>

<h2 id="规范">规范</h2>
Expand Down
4 changes: 2 additions & 2 deletions files/zh-cn/web/http/status/414/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<p>以下是造成这种罕见情况的几种可能原因:</p>

<ul>
<li>当客户端误将 {{HTTPMethod("POST")}} 请求当作 {{HTTPMethod("GET")}} 请求时,会带有一个较长的查询字符串(query);</li>
<li>当客户端堕入重定向循环黑洞时,例如,指向自身后缀的重定向URI前缀(a redirected URI prefix that points to a suffix of itself);</li>
<li>当客户端误将 {{HTTPMethod("POST")}} 请求当作 {{HTTPMethod("GET")}} 请求时,会带有一个较长的查询字符串 (query);</li>
<li>当客户端堕入重定向循环黑洞时,例如,指向自身后缀的重定向 URI 前缀 (a redirected URI prefix that points to a suffix of itself);</li>
<li>当客户端对服务器进行攻击,试图寻找潜在的漏洞时。</li>
</ul>

Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/http/status/415/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
---
<div>{{HTTPSidebar}}</div>

<p><code><strong>415 Unsupported Media Type</strong></code> 是一种HTTP协议的错误状态代码,表示服务器由于不支持其有效载荷的格式,从而拒绝接受客户端的请求。</p>
<p><code><strong>415 Unsupported Media Type</strong></code> 是一种 HTTP 协议的错误状态代码,表示服务器由于不支持其有效载荷的格式,从而拒绝接受客户端的请求。</p>

<p>格式问题的出现有可能源于客户端在 {{HTTPHeader("Content-Type")}} 或 {{HTTPHeader("Content-Encoding")}} 首部中指定的格式,也可能源于直接对负载数据进行检测的结果。</p>

Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/http/status/417/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
---
<div>{{HTTPSidebar}}</div>

<p>HTTP协议中的  <strong><code>417 Expectation Failed</code></strong> 状态码表示客户端错误,意味着服务器无法满足 {{HTTPHeader("Expect")}} 请求消息头中的期望条件。</p>
<p>HTTP 协议中的 <strong><code>417 Expectation Failed</code></strong> 状态码表示客户端错误,意味着服务器无法满足 {{HTTPHeader("Expect")}} 请求消息头中的期望条件。</p>

<p>参考 {{HTTPHeader("Expect")}} 消息头获得更多的相关细节信息。</p>

Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/http/status/418/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h2 id="说明书">说明书</h2>
</tr>
<tr>
<td>{{RFC("2324", "418 I'm a teapot" , "2.3.2")}}</td>
<td>超文本咖啡壶控制协议(HTCPCP/1.0):语义和内容</td>
<td>超文本咖啡壶控制协议 (HTCPCP/1.0):语义和内容</td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/http/status/426/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
---
<div>{{HTTPSidebar}}</div>

<p><code><strong>426 Upgrade Required</strong></code> 是一种HTTP协议的错误状态代码,表示服务器拒绝处理客户端使用当前协议发送的请求,但是可以接受其使用升级后的协议发送的请求。</p>
<p><code><strong>426 Upgrade Required</strong></code> 是一种 HTTP 协议的错误状态代码,表示服务器拒绝处理客户端使用当前协议发送的请求,但是可以接受其使用升级后的协议发送的请求。</p>

<p>服务器会在响应中使用 {{HTTPHeader("Upgrade")}} 首部来指定要求的协议。</p>

Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/http/status/428/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
---
<div>{{HTTPSidebar}}</div>

<p>在HTTP协议中,响应状态码  <code><strong>428 Precondition Required</strong></code> 表示服务器端要求发送<a href="/en-US/docs/Web/HTTP/Conditional_requests">条件</a>请求。</p>
<p>在 HTTP 协议中,响应状态码 <code><strong>428 Precondition Required</strong></code> 表示服务器端要求发送<a href="/en-US/docs/Web/HTTP/Conditional_requests">条件</a>请求。</p>

<p>一般的,这种情况意味着必要的条件首部——如 {{HTTPHeader("If-Match")}} ——的<strong>缺失。</strong>.</p>

Expand Down
4 changes: 2 additions & 2 deletions files/zh-cn/web/http/status/429/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
title: 429 Too Many Requests
slug: Web/HTTP/Status/429
tags:
- HTTP协议
- HTTP 协议
- 客户端错误
- 状态码
translation_of: Web/HTTP/Status/429
---
<div>{{HTTPSidebar}}</div>

<p>在HTTP协议中,响应状态码  <code><strong>429 Too Many Requests</strong></code> 表示在一定的时间内用户发送了太多的请求,即超出了“频次限制”。</p>
<p>在 HTTP 协议中,响应状态码 <code><strong>429 Too Many Requests</strong></code> 表示在一定的时间内用户发送了太多的请求,即超出了“频次限制”。</p>

<p>在响应中,可以提供一个  {{HTTPHeader("Retry-After")}} 首部来提示用户需要等待多长时间之后再发送新的请求。</p>

Expand Down
4 changes: 2 additions & 2 deletions files/zh-cn/web/http/status/451/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
---
<div>{{HTTPSidebar}}</div>

<p><code><strong>451</strong></code><strong><code> Unavailable For Legal Reasons</code></strong> (因法律原因不可用)是一种HTTP协议的错误状态代码,表示服务器由于法律原因,无法提供客户端请求的资源,例如可能会导致法律诉讼的页面。</p>
<p><code><strong>451</strong></code><strong><code> Unavailable For Legal Reasons</code></strong> (因法律原因不可用)是一种 HTTP 协议的错误状态代码,表示服务器由于法律原因,无法提供客户端请求的资源,例如可能会导致法律诉讼的页面。</p>

<h2 id="状态">状态</h2>

<pre class="syntaxbox">451 Unavailable For Legal Reasons</pre>

<h2 id="示例">示例</h2>

<p>这个响应示例来自 IETF RFC 规范(见下文),其中提到了英国戏剧电影{{interwiki("wikipedia", "蒙提·派森之布莱恩的一生", "Monty Python's Life of Brian")}} (《蒙提·派森之布莱恩的一生》)。</p>
<p>这个响应示例来自 IETF RFC 规范(见下文),其中提到了英国戏剧电影{{interwiki("wikipedia", "蒙提·派森之布莱恩的一生", "Monty Python's Life of Brian")}}(《蒙提·派森之布莱恩的一生》)。</p>

<p>注意 {{HTTPHeader("Link")}} 首部中可能会包含一个 <code>rel="blocked-by"</code> 字段,用于标明为该资源无法提供负责的主体,例如颁布法令将资源删除的个人或组织的名称。</p>

Expand Down
4 changes: 2 additions & 2 deletions files/zh-cn/web/http/status/502/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
---
<div>{{HTTPSidebar}}</div>

<p><code><strong>502</strong></code><strong><code> Bad Gateway</code></strong> 是一种HTTP协议的服务器端错误状态代码,它表示作为网关或代理角色的服务器,从上游服务器(如tomcat、php-fpm)中接收到的响应是无效的。</p>
<p><code><strong>502 Bad Gateway</code></strong> 是一种 HTTP 协议的服务器端错误状态代码,它表示作为网关或代理角色的服务器,从上游服务器(如 tomcat、php-fpm)中接收到的响应是无效的。</p>

<p>{{interwiki("wikipedia", "Gateway_(telecommunications)", "Gateway")}} (网关)在计算机网络体系中可以指代不同的设备,502 错误通常不是客户端能够修复的,而是需要由途径的Web服务器或者代理服务器对其进行修复。</p>
<p>{{interwiki("wikipedia", "Gateway_(telecommunications)", "Gateway")}}(网关)在计算机网络体系中可以指代不同的设备,502 错误通常不是客户端能够修复的,而是需要由途径的 Web 服务器或者代理服务器对其进行修复。</p>

<h2 id="状态">状态</h2>

Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/http/status/503/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
---
<div>{{HTTPSidebar}}</div>

<p><code><strong>503</strong></code><strong><code> Service Unavailable</code></strong> 是一种HTTP协议的服务器端错误状态代码,它表示服务器尚未处于可以接受请求的状态。</p>
<p><code><strong>503 Service Unavailable</code></strong> 是一种 HTTP 协议的服务器端错误状态代码,它表示服务器尚未处于可以接受请求的状态。</p>

<p>通常造成这种情况的原因是由于服务器停机维护或者已超载。注意在发送该响应的时候,应该同时发送一个对用户友好的页面来解释问题发生的原因。该种响应应该用于临时状况下,与之同时,在可行的情况下,应该在 {{HTTPHeader("Retry-After")}} 首部字段中包含服务恢复的预期时间。</p>

Expand Down
4 changes: 2 additions & 2 deletions files/zh-cn/web/http/status/504/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
---
<div>{{HTTPSidebar}}</div>

<p><code><strong>504</strong></code><strong><code> Gateway Timeout</code></strong> 是一种HTTP协议的服务器端错误状态代码,表示扮演网关或者代理的服务器无法在规定的时间内获得想要的响应。</p>
<p><code><strong>504 Gateway Timeout</code></strong> 是一种 HTTP 协议的服务器端错误状态代码,表示扮演网关或者代理的服务器无法在规定的时间内获得想要的响应。</p>

<p>{{interwiki("wikipedia", "Gateway_(telecommunications)", "Gateway")}} (网关)在计算机网络体系中可以指代不同的设备,504 错误通常不是在客户端可以修复的,而是需要由途径的Web服务器或者代理服务器对其进行修复。</p>
<p>{{interwiki("wikipedia", "Gateway_(telecommunications)", "Gateway")}}(网关)在计算机网络体系中可以指代不同的设备,504 错误通常不是在客户端可以修复的,而是需要由途径的 Web 服务器或者代理服务器对其进行修复。</p>

<h2 id="状态">状态</h2>

Expand Down
2 changes: 1 addition & 1 deletion files/zh-cn/web/http/status/505/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
---
<div>{{HTTPSidebar}}</div>

<p><code><strong>505</strong></code><strong><code> HTTP Version Not Supported</code></strong> 是一种HTTP协议的服务器端错误状态代码,表示服务器不支持请求所使用的 HTTP 版本。</p>
<p><code><strong>505 HTTP Version Not Supported</code></strong> 是一种 HTTP 协议的服务器端错误状态代码,表示服务器不支持请求所使用的 HTTP 版本。</p>

<h2 id="状态">状态</h2>

Expand Down
Loading