aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/http/status/101/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/http/status/101/index.html')
-rw-r--r--files/zh-cn/web/http/status/101/index.html50
1 files changed, 50 insertions, 0 deletions
diff --git a/files/zh-cn/web/http/status/101/index.html b/files/zh-cn/web/http/status/101/index.html
new file mode 100644
index 0000000000..855ef3e587
--- /dev/null
+++ b/files/zh-cn/web/http/status/101/index.html
@@ -0,0 +1,50 @@
+---
+title: 101 Switching Protocol
+slug: Web/HTTP/Status/101
+tags:
+ - HTTP
+ - HTTP 状态码
+translation_of: Web/HTTP/Status/101
+---
+<div>{{HTTPSidebar}}</div>
+
+<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>
+
+<h2 id="状态">状态</h2>
+
+<pre class="syntaxbox notranslate">101 Switching Protocol</pre>
+
+<h2 id="示例">示例</h2>
+
+<p>在使用 <a href="/en-US/docs/Web/API/WebSockets_API">WebSockets</a> 时会用到协议切换。</p>
+
+<pre class="notranslate">HTTP/1.1 101 Switching Protocols
+Upgrade: websocket
+Connection: Upgrade</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", "101 Switching Protocol" , "6.2.2")}}</td>
+ <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism">Protocol upgrade mechanism</a></li>
+ <li><a href="/en-US/docs/Web/API/WebSockets_API">WebSockets</a></li>
+ <li>{{HTTPHeader("Upgrade")}}</li>
+ <li>{{HTTPStatus("426")}} <code>Upgrade Required</code></li>
+</ul>