diff options
Diffstat (limited to 'files/zh-tw/web/http/status')
23 files changed, 1244 insertions, 0 deletions
diff --git a/files/zh-tw/web/http/status/100/index.html b/files/zh-tw/web/http/status/100/index.html new file mode 100644 index 0000000000..79fb0c9bfd --- /dev/null +++ b/files/zh-tw/web/http/status/100/index.html @@ -0,0 +1,42 @@ +--- +title: 100 Continue +slug: Web/HTTP/Status/100 +translation_of: Web/HTTP/Status/100 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <strong><code>100 Continue</code></strong> 訊息狀態回應碼表示,目前為止的一切完好,用戶端應該繼續完成請求,或當請求已經完成的狀態下應忽略此訊息。</p> + +<p>若要使伺服器確認請求標頭,用戶端必須在最初請求的標頭中,傳送{{HTTPHeader("Expect")}}<code>: 100-continue</code> ,並且在傳送主體前,接收 <code>100 Continue</code> 狀態碼。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">100 Continue</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", "100 Continue" , "6.2.1")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</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.status.100")}}</p> + +<h2 id="參見">參見</h2> + +<ul> + <li>{{HTTPHeader("Expect")}}</li> + <li>{{HTTPStatus(417)}}</li> +</ul> diff --git a/files/zh-tw/web/http/status/101/index.html b/files/zh-tw/web/http/status/101/index.html new file mode 100644 index 0000000000..f801edfd37 --- /dev/null +++ b/files/zh-tw/web/http/status/101/index.html @@ -0,0 +1,46 @@ +--- +title: 101 Switching Protocols +slug: Web/HTTP/Status/101 +translation_of: Web/HTTP/Status/101 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <code><strong>101 Switching Protocols</strong></code> 回應碼表示伺服器正在切換到用戶端在請求標頭{{HTTPHeader("Upgrade")}} 中所要求的通訊協定。</p> + +<p>伺服端將在回應中包含 {{HTTPHeader("Upgrade")}} 標頭以表明其所切換的通訊協定。此過程在文章 <a href="/zh-TW/docs/Web/HTTP/Protocol_upgrade_mechanism">Protocol upgrade mechanism</a> 中有更加詳細的描述。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">101 Switching Protocols</pre> + +<h2 id="範例">範例</h2> + +<p>通訊協定切換可能會用於 <a href="/en-US/docs/Web/API/WebSockets_API">WebSockets</a> 中。</p> + +<pre>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> diff --git a/files/zh-tw/web/http/status/200/index.html b/files/zh-tw/web/http/status/200/index.html new file mode 100644 index 0000000000..f9b94fd6df --- /dev/null +++ b/files/zh-tw/web/http/status/200/index.html @@ -0,0 +1,50 @@ +--- +title: 200 OK +slug: Web/HTTP/Status/200 +translation_of: Web/HTTP/Status/200 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <strong><code>200 OK</code></strong> 成功狀態碼表明請求成功。200 回應預設上是緩存的(cacheable)。</p> + +<p>所謂「成功」的定義,取決於 HTTP 的請求方法:</p> + +<ul> + <li>{{HTTPMethod("GET")}}:資源已取得,並傳送到訊息內文(message body)。</li> + <li>{{HTTPMethod("HEAD")}}:整個標已經放在訊息內文了。</li> + <li>{{HTTPMethod("POST")}}: 描述動作結果的資源已經傳送到訊息內文。</li> + <li>{{HTTPMethod("TRACE")}}:訊息內文包含了請求訊息,伺服器也接受了請求。</li> +</ul> + +<p>{{HTTPMethod("PUT")}} 或 {{HTTPMethod("DELETE")}} 的成功訊息,通常不是 <code>200 OK</code>,而是 {{HTTPStatus("204")}} <code>No Content</code>(或著在資源首次上傳時,{{HTTPStatus("201")}} <code>Created</code>)。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">200 OK</pre> + +<h2 id="規範">規範</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">規範</th> + <th scope="col">標題</th> + </tr> + <tr> + <td>{{RFC("7231", "200 OK" , "6.3.1")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</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.status.200")}}</p> + +<h2 id="參見">參見</h2> + +<ul> + <li><a href="/zh-TW/docs/Web/HTTP/Methods">HTTP 請求方法</a></li> +</ul> diff --git a/files/zh-tw/web/http/status/201/index.html b/files/zh-tw/web/http/status/201/index.html new file mode 100644 index 0000000000..1da5ec6edd --- /dev/null +++ b/files/zh-tw/web/http/status/201/index.html @@ -0,0 +1,43 @@ +--- +title: 201 Created +slug: Web/HTTP/Status/201 +translation_of: Web/HTTP/Status/201 +--- +<p>HTTP <strong><code>201 Created</code></strong> 成功狀態碼表示請求成功且有一個新的資源已經依據需要而被建立。實際上,在此回應傳送前,新資源就已被建立,且其內容在訊息的主體中傳回,其位置為請求的 URL 或是 {{HTTPHeader("Location")}} 標頭的內容。</p> + +<p>此狀態碼通常用於 {{HTTPMethod("POST")}} 請求的回應中。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">201 Created</pre> + +<h2 id="規範">規範</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Title</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{RFC("7231", "201 Created" , "6.3.2")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</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.status.201")}}</p> + +<h2 id="參見">參見</h2> + +<ul> + <li><a href="/zh-TW/docs/Web/HTTP/Methods">HTTP 請求方法</a></li> +</ul> + +<div>{{HTTPSidebar}}</div> diff --git a/files/zh-tw/web/http/status/202/index.html b/files/zh-tw/web/http/status/202/index.html new file mode 100644 index 0000000000..04221bbebd --- /dev/null +++ b/files/zh-tw/web/http/status/202/index.html @@ -0,0 +1,33 @@ +--- +title: 202 Accepted +slug: Web/HTTP/Status/202 +translation_of: Web/HTTP/Status/202 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <code><strong>202 Accepted</strong></code> 成功狀態碼表示此請求已經被接受但尚未處理。此狀態為非承諾性,代表 HTTP 無法在之後傳送一個非同步的回應告知請求的處理結果。最初<span class="tlid-translation translation" lang="zh-TW"><span title="">目的為外部程序或其他伺服器處理</span></span>請求的情況,或用於批次處理中。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">202 Accepted</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", "202 Accepted" , "6.3.3")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td> + </tr> + </tbody> +</table> + +<h2 id="參見">參見</h2> + +<ul> + <li>{{HTTPHeader("Accept")}}</li> +</ul> diff --git a/files/zh-tw/web/http/status/203/index.html b/files/zh-tw/web/http/status/203/index.html new file mode 100644 index 0000000000..66e3df7022 --- /dev/null +++ b/files/zh-tw/web/http/status/203/index.html @@ -0,0 +1,37 @@ +--- +title: 203 Non-Authoritative Information +slug: Web/HTTP/Status/203 +translation_of: Web/HTTP/Status/203 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <strong><code>203 Non-Authoritative Information</code></strong> 狀態碼表明請求成功,但是與原始伺服器的 {{HTTPStatus("200")}} (<code>OK</code>) 回應相比,<span class="tlid-translation translation" lang="zh-TW"><span title="">隨附的</span></span>酬載<span class="tlid-translation translation" lang="zh-TW"><span title="">已被具</span></span>轉換功能的 {{Glossary("Proxy server", "代理伺服器")}} <span class="tlid-translation translation" lang="zh-TW"><span title="">所修改</span></span>。</p> + +<p><code>203</code> 回應相似於 {{HTTPHeader("Warning")}} 標頭的 <code><a href="/en-US/docs/Web/HTTP/Headers/Warning#Warning_codes">214</a> Transformation Applied</code>,但後者的額外的優點在於可以套用到任何狀態碼的回應中。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">203 Non-Authoritative Information</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", "203 Non-Authoritative Information" , "6.3.4")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td> + </tr> + </tbody> +</table> + +<h2 id="參見">參見</h2> + +<ul> + <li>{{HTTPStatus("200")}}</li> + <li>{{Glossary("Proxy server")}}</li> + <li>{{HTTPHeader("Warning")}}</li> +</ul> diff --git a/files/zh-tw/web/http/status/204/index.html b/files/zh-tw/web/http/status/204/index.html new file mode 100644 index 0000000000..ec60934d81 --- /dev/null +++ b/files/zh-tw/web/http/status/204/index.html @@ -0,0 +1,49 @@ +--- +title: 204 No Content +slug: Web/HTTP/Status/204 +translation_of: Web/HTTP/Status/204 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <strong><code>204 No Content</code></strong> 成功狀態碼表明請求成功,但客戶端不需要更新目前的頁面。204 回應預設是可被快取的,此類回應中會包含 {{HTTPHeader("ETag")}} 標頭。</p> + +<p>回傳 <code>204</code> 的常見情況是作為 {{HTTPMethod("PUT")}} 請求的回應,更新一個資源且沒有更動目前顯示給使用者的頁面內容。若是有資源被建立,{{HTTPStatus("201")}} <code>Created</code> 則應該被回傳。而若頁面應該更新為新的頁面,則應使用 {{HTTPStatus("200")}} 。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">204 No Content</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", "204 No Content" , "6.3.5")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</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.status.204")}}</p> + +<h2 id="相容性事項">相容性事項</h2> + +<ul> + <li>雖然此狀態碼意圖表示不具主體的回應,伺服器仍可能錯誤地在標頭後加入資料。通訊協定允許使用者代理更動此回應的處理方式 (<a href="https://github.com/httpwg/http11bis/issues/26">關於規範的討論請參見此處</a>)。這在<span class="st">持久連接中可以被觀察到,</span>無效的主體可能會包含<span class="tlid-translation translation" lang="zh-TW"><span title="">後續請求的不同回應</span></span> 。<br> + <br> + Apple Safari 拒收這些資料。Google Chrome 及 Microsoft Edge <span class="tlid-translation translation" lang="zh-TW"><span title="">在有效回應之前丟棄最多四個無效的位元組。</span></span>Firefox 容許<span class="tlid-translation translation" lang="zh-TW"><span title="">在有效回應之前</span></span>超過1KB 的無效資料。</li> +</ul> + +<h2 id="參見">參見</h2> + +<ul> + <li><a href="https://developer.mozilla.org/zh-TW/docs/Web/HTTP/Methods">HTTP請求方法</a></li> +</ul> diff --git a/files/zh-tw/web/http/status/205/index.html b/files/zh-tw/web/http/status/205/index.html new file mode 100644 index 0000000000..3ef8a05ae2 --- /dev/null +++ b/files/zh-tw/web/http/status/205/index.html @@ -0,0 +1,39 @@ +--- +title: 205 Reset Content +slug: Web/HTTP/Status/205 +translation_of: Web/HTTP/Status/205 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <strong><code>205 Reset Content</code></strong> 狀態碼用來通知客戶端重置文件視圖,例如:清除表單內容、重置畫布狀態或刷新使用者界面。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">205 Reset Content</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", "205 Reset Content" , "6.3.6")}}</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/Status/204">204 No Content</a> 。</li> +</ul> + +<h2 id="參見">參見</h2> + +<ul> + <li>{{HTTPStatus(204)}} No Content</li> +</ul> diff --git a/files/zh-tw/web/http/status/206/index.html b/files/zh-tw/web/http/status/206/index.html new file mode 100644 index 0000000000..bb013ff1c8 --- /dev/null +++ b/files/zh-tw/web/http/status/206/index.html @@ -0,0 +1,79 @@ +--- +title: 206 Partial Content +slug: Web/HTTP/Status/206 +translation_of: Web/HTTP/Status/206 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <strong><code>206 Partial Content</code></strong> 成功狀態碼表明請求成功,且主體包含在請求標頭{{HTTPHeader("Range")}} 中所指定的資料區間。</p> + +<p>若只包含一個區間,則整個回應的 {{HTTPHeader("Content-Type")}} 將會被設為該文件的類型 ,且會包含一個 {{HTTPHeader("Content-Range")}} 標頭。</p> + +<p>若有多個區間,則整個回應的 {{HTTPHeader("Content-Type")}} 會被設為 <code>multipart/byteranges</code> ,且每個分段會對應一個區間,並有 {{HTTPHeader("Content-Range")}} 及 {{HTTPHeader("Content-Type")}} 描述各個區間。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">206 Partial Content</pre> + +<h2 id="範例">範例</h2> + +<p>一個包含單一區間的回應:</p> + +<pre class="newpage">HTTP/1.1 206 Partial Content +Date: Wed, 15 Nov 2015 06:25:24 GMT +Last-Modified: Wed, 15 Nov 2015 04:58:08 GMT +Content-Range: bytes 21010-47021/47022 +Content-Length: 26012 +Content-Type: image/gif + +... 26012 bytes of partial image data ...</pre> + +<p>一個包含多個區間的回應:</p> + +<pre class="newpage">HTTP/1.1 206 Partial Content +Date: Wed, 15 Nov 2015 06:25:24 GMT +Last-Modified: Wed, 15 Nov 2015 04:58:08 GMT +Content-Length: 1741 +Content-Type: multipart/byteranges; boundary=String_separator + +--String_separator +Content-Type: application/pdf +Content-Range: bytes 234-639/8000 + +...the first range... +--String_separator +Content-Type: application/pdf +Content-Range: bytes 4590-7999/8000 + +...the second range +--String_separator--</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", "206 Partial Content" , "4.1")}}</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.status.206")}}</p> + +<h2 id="參見">參見</h2> + +<ul> + <li>{{HTTPHeader("If-Range")}}</li> + <li>{{HTTPHeader("Range")}}</li> + <li>{{HTTPHeader("Content-Range")}}</li> + <li>{{HTTPHeader("Content-Type")}}</li> +</ul> diff --git a/files/zh-tw/web/http/status/300/index.html b/files/zh-tw/web/http/status/300/index.html new file mode 100644 index 0000000000..40a878c849 --- /dev/null +++ b/files/zh-tw/web/http/status/300/index.html @@ -0,0 +1,38 @@ +--- +title: 300 Multiple Choices +slug: Web/HTTP/Status/300 +translation_of: Web/HTTP/Status/300 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <code><strong>300 Multiple Choices</strong></code> 重定向回應碼代表該請求具有超過一種可能的回應。用戶代理或使用者應該從中挑選一個。由於不存在標準化的選擇回應方式,此回應碼非常少被使用。</p> + +<p>若是伺服端有偏好的選擇,則應該產生 {{HTTPHeader("Location")}} 標頭。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">300 Multiple Choices +</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", "300 Multiple Choices" , "6.4.1")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td> + </tr> + </tbody> +</table> + +<h2 id="參見">參見</h2> + +<ul> + <li>{{HTTPStatus("301")}} <code>Moved Permanently</code></li> + <li>{{HTTPStatus("302")}} <code>Found</code>, the temporary redirect</li> + <li>{{HTTPStatus("308")}} <code>Permanent Redirect</code></li> +</ul> diff --git a/files/zh-tw/web/http/status/301/index.html b/files/zh-tw/web/http/status/301/index.html new file mode 100644 index 0000000000..8fe00054ee --- /dev/null +++ b/files/zh-tw/web/http/status/301/index.html @@ -0,0 +1,54 @@ +--- +title: 301 Moved Permanently +slug: Web/HTTP/Status/301 +translation_of: Web/HTTP/Status/301 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <code><strong>301 Moved Permanently</strong></code> 重定向回應碼代表所請求的資源已經被明確移動到 {{HTTPHeader("Location")}} 標頭所指示的 URL。瀏覽器會重新導向到此頁面,而搜尋引擎則會更新該資源的連結。用 SEO 的話來說,就是連結養分(link-juice)把你送到了新的 URL 去。</p> + +<p>儘管規範要求當執行重新導向時,請求方法 (以及主體) 不應該被更動,但並非所有的用戶代理皆遵循它 -- 你依然可以找到具有此類漏洞的軟體。因此,推薦只使用 <code>301</code> 回應碼作為 {{HTTPMethod("GET")}} 或 {{HTTPMethod("HEAD")}} 方法的回應, 另外使用 {{HTTPStatus("308", "308 Permanent Redirect")}} 作為 {{HTTPMethod("POST")}} 方法的替代,因為請求方法的更動在此狀態中是被明確禁止的。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">301 Moved Permanently</pre> + +<h2 id="範例">範例</h2> + +<h3 id="用戶端請求">用戶端請求</h3> + +<pre>GET /index.php HTTP/1.1 +Host: www.example.org</pre> + +<h3 id="伺服端回應">伺服端回應</h3> + +<pre>HTTP/1.1 301 Moved Permanently +Location: http://www.example.org/index.asp</pre> + +<h2 id="規範">規範</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">規範</th> + <th scope="col">標題</th> + </tr> + <tr> + <td>{{RFC("7231", "301 Moved Permanently" , "6.4.2")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td> + </tr> + </tbody> +</table> + +<h2 id="瀏覽器相容性">瀏覽器相容性</h2> + + + +<p>{{Compat("http.status.301")}}</p> + +<h2 id="參見">參見</h2> + +<ul> + <li>{{HTTPStatus("308", "308 Permanent Redirect")}}</li> + <li>{{HTTPStatus("302", "302 Found")}}, 臨時重新導向</li> +</ul> diff --git a/files/zh-tw/web/http/status/403/index.html b/files/zh-tw/web/http/status/403/index.html new file mode 100644 index 0000000000..9ad06b2fe5 --- /dev/null +++ b/files/zh-tw/web/http/status/403/index.html @@ -0,0 +1,49 @@ +--- +title: 403 Forbidden +slug: Web/HTTP/Status/403 +translation_of: Web/HTTP/Status/403 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <strong><code>403 Forbidden</code></strong> 客戶端錯誤狀態碼表示伺服器理解該請求但拒絕核准。</p> + +<p>該狀態碼與 HTTP {{HTTPStatus("401")}} 類似,但重新身分驗證不能提供幫助。 存取被永久性禁止,且與應用程式邏輯有關,如資源的訪問權限不足。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">403 Forbidden</pre> + +<h2 id="回應範例">回應範例</h2> + +<pre>HTTP/1.1 403 Forbidden +Date: Wed, 21 Oct 2015 07:28:00 GMT +</pre> + +<h2 id="規範">規範</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Title</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{RFC("7231", "403 Forbidden" , "6.5.3")}}</td> + <td>HTTP/1.1: Semantics and Content</td> + </tr> + </tbody> +</table> + +<h2 id="瀏覽器相容性"><a href="https://developer.mozilla.org/zh-TW/docs/Web/HTTP/Status/100$edit#%E7%80%8F%E8%A6%BD%E5%99%A8%E7%9B%B8%E5%AE%B9%E6%80%A7" rel="nofollow, noindex">瀏覽器相容性</a></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.status.403")}}</p> + +<h2 id="參見">參見</h2> + +<ul> + <li>{{HTTPStatus("401")}}</li> +</ul> diff --git a/files/zh-tw/web/http/status/404/index.html b/files/zh-tw/web/http/status/404/index.html new file mode 100644 index 0000000000..0e7051452f --- /dev/null +++ b/files/zh-tw/web/http/status/404/index.html @@ -0,0 +1,59 @@ +--- +title: 404 Not Found +slug: Web/HTTP/Status/404 +translation_of: Web/HTTP/Status/404 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <code><strong>404 Not Found</strong></code> 用戶端錯誤回應碼,表明了伺服器找不到請求的資源。引發 404 頁面的連結,通常被稱作斷連或死連(broken or dead link)、並可以導到失效連結(<a href="https://en.wikipedia.org/wiki/Link_rot">link rot</a>)頁面。</p> + +<p>404 狀態碼並沒有表明資源是暫時不見、還是永遠不見。如果資源是永遠不見,就應該用 {{HTTPStatus(410)}}(Gone) 而不是 404。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox notranslate">404 Not Found</pre> + +<h2 id="自訂錯誤頁面">自訂錯誤頁面</h2> + +<p>很多網站都會自訂 404 錯誤頁面,以便在指引用戶後續動作方面,提供進一步的幫助。Apache 伺服器可以透過 <code>.htaccess</code> 檔案設定,程式碼如下:</p> + +<pre class="brush: bash notranslate">ErrorDocument 404 /notfound.html</pre> + +<p>要參考自訂 404 錯誤頁面範例,請看看 <a href="https://developer.mozilla.org/zh-TW/404">MDN 的 404 頁面</a>。</p> + +<div class="note"> +<p>適度地客製是件好事:你可以讓 404 頁面幽默和人性化,但不要讓用戶困惑。</p> +</div> + +<h2 id="規範">規範</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">規範</th> + <th scope="col">標題</th> + </tr> + <tr> + <td>{{RFC("7231", "404 Not Found" , "6.5.4")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</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.status.404")}}</p> + +<h2 id="參見">參見</h2> + +<ul> + <li>{{HTTPStatus(410)}}</li> + <li> + <p>{{interwiki("wikipedia", "HTTP_404", "維基百科的 HTTP 404")}}</p> + </li> + <li> + <p><a href="https://www.exai.com/blog/404-http-error">404 Error </a></p> + </li> +</ul> diff --git a/files/zh-tw/web/http/status/409/index.html b/files/zh-tw/web/http/status/409/index.html new file mode 100644 index 0000000000..30c715c984 --- /dev/null +++ b/files/zh-tw/web/http/status/409/index.html @@ -0,0 +1,35 @@ +--- +title: 409 Conflict +slug: Web/HTTP/Status/409 +translation_of: Web/HTTP/Status/409 +--- +<div>{{HTTPSidebar}}</div> + +<p> HTTP <code><strong>409 Conflict</strong></code> 表示請求與伺服器目前狀態衝突</p> + +<p>衝突通常發生於 {{HTTPMethod("PUT")}} 請求。如上傳一個已經有舊版本存在於伺服器的檔案而導致版本控制衝突時,會回復一個 409 錯誤。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">409 Conflict</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", "409 Conflict" , "6.5.8")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td> + </tr> + </tbody> +</table> + +<h2 id="參見">參見</h2> + +<ul> + <li>{{HTTPMethod("PUT")}}</li> +</ul> diff --git a/files/zh-tw/web/http/status/411/index.html b/files/zh-tw/web/http/status/411/index.html new file mode 100644 index 0000000000..0e23db4f27 --- /dev/null +++ b/files/zh-tw/web/http/status/411/index.html @@ -0,0 +1,38 @@ +--- +title: 411 Length Required +slug: Web/HTTP/Status/411 +translation_of: Web/HTTP/Status/411 +--- +<div>{{HTTPSidebar}}</div> + +<p>超文本傳輸協定 (HTTP) <code><strong>411 Length Required</strong></code> 用戶端錯誤表示伺服器拒絕接收沒有定義 {{HTTPHeader("Content-Length")}} 頭的請求。 </p> + +<div class="note"> +<p><strong>Note: </strong>by specification, when sending data in a series of chunks, the <code>Content-Length</code> header is omitted and at the beginning of each chunk you need to add the length of the current chunk in hexadecimal format. See {{HTTPHeader("Transfer-Encoding")}} for more details.</p> +</div> + +<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> diff --git a/files/zh-tw/web/http/status/415/index.html b/files/zh-tw/web/http/status/415/index.html new file mode 100644 index 0000000000..1cb159f46c --- /dev/null +++ b/files/zh-tw/web/http/status/415/index.html @@ -0,0 +1,39 @@ +--- +title: 415 Unsupported Media Type +slug: Web/HTTP/Status/415 +translation_of: Web/HTTP/Status/415 +--- +<div> +<p><font><font>{{HTTPSidebar}}</font></font></p> + +<p><font><font>HTTP </font></font><code><strong>415 Unsupported Media Type</strong></code> <font><font>用戶端的錯誤表示</font></font><font><font>被請求資源的多媒體類型不被伺服器支援,因此該請求被拒絕。</font></font></p> + +<p><font><font>該格式問體可能源自於請求中設置的 </font></font>{{HTTPHeader("Content-Type")}} 或 {{HTTPHeader("Content-Encoding")}}<font><font> 或對資料的直接訪問。</font></font></p> +</div> + +<h2 id="狀態"><font><font>狀態</font></font></h2> + +<pre>415 Unsupported Media Type</pre> + +<h2 id="規範"><font><font>規範</font></font></h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col"><font><font>規格</font></font></th> + <th scope="col"><font><font>標題</font></font></th> + </tr> + <tr> + <td>{{RFC("7231", "415 Unsupported Media Type" , "6.5.13")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td> + </tr> + </tbody> +</table> + +<h2 id="參見"><font><font>參見</font></font></h2> + +<ul> + <li>{{HTTPHeader("Content-Type")}}</li> + <li>{{HTTPHeader("Content-Encoding")}}</li> + <li>{{HTTPHeader("Accept")}}</li> +</ul> diff --git a/files/zh-tw/web/http/status/418_i_m_a_teapot/index.html b/files/zh-tw/web/http/status/418_i_m_a_teapot/index.html new file mode 100644 index 0000000000..0f03f77c24 --- /dev/null +++ b/files/zh-tw/web/http/status/418_i_m_a_teapot/index.html @@ -0,0 +1,45 @@ +--- +title: 418 I'm a teapot +slug: Web/HTTP/Status/418_I_m_a_teapot +translation_of: Web/HTTP/Status/418 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <strong><code>418 I'm a teapot</code></strong> 用戶端錯誤碼表明了伺服器是個(永久性的)茶壺,所以拒絕煮咖啡。一個結合了咖啡與茶壺的壺子暫時沒咖啡的情境,應該回傳 503。這個錯誤是源自於 1998 與 2014 的愚人節玩笑「超文字咖啡壺控制協定」(Hyper Text Coffee Pot Control Protocol)。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">418 I'm a teapot</pre> + +<h2 id="規範">規範</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">規範</th> + <th scope="col">標題</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{RFC("2324", "418 I'm a teapot" , "2.3.2")}}</td> + <td>Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0): Semantics and Content</td> + </tr> + <tr> + <td>{{RFC("7168", "418 I'm a teapot" , "2.3.3")}}</td> + <td>The Hyper Text Coffee Pot Control Protocol for Tea Efflux Appliances (HTCPCP-TEA): Response Codes</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.status.418")}}</p> + +<h2 id="參見">參見</h2> + +<ul> + <li>{{interwiki("wikipedia", "超文字咖啡壺控制協定", "維基百科的「超文字咖啡壺控制協定」")}}</li> +</ul> diff --git a/files/zh-tw/web/http/status/451/index.html b/files/zh-tw/web/http/status/451/index.html new file mode 100644 index 0000000000..ce4817643f --- /dev/null +++ b/files/zh-tw/web/http/status/451/index.html @@ -0,0 +1,65 @@ +--- +title: 451 Unavailable For Legal Reasons +slug: Web/HTTP/Status/451 +translation_of: Web/HTTP/Status/451 +--- +<p>{{HTTPSidebar}}</p> + +<p>HTTP <code><strong>451 Unavailable For Legal Reasons</strong></code> 用戶端錯誤回應碼表明用戶請求的資源,出於法律原因而無法使用,例如遭受法律訴訟的網頁。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">451 Unavailable For Legal Reasons</pre> + +<h2 id="示例">示例</h2> + +<p>此示例擷取自 IETF RFC(參見以下章節)、包含了{{interwiki("wikipedia", "萬世魔星")}}的引用。</p> + +<p><strong>註:</strong>{{HTTPHeader("Link")}} 標頭可能包含 <code>rel="blocked-by"</code> 以表明是誰封鎖該資源,而非來自其他強制力量。</p> + +<p>需要為該資源無效的負責者,例如請求法律移除內容的人名或組織名,並不會放在 <code>rel="blocked-by"</code> link 裡面。</p> + +<pre>HTTP/1.1 451 Unavailable For Legal Reasons +Link: <https://spqr.example.org/legislatione>; rel="blocked-by" +Content-Type: text/html</pre> + +<pre><html> + <head><title>Unavailable For Legal Reasons</title></head> + <body> + <h1>Unavailable For Legal Reasons</h1> + <p>This request may not be serviced in the Roman Province + of Judea due to the Lex Julia Majestatis, which disallows + access to resources hosted on servers deemed to be + operated by the People's Front of Judea.</p> + </body> +</html></pre> + +<h2 id="規範">規範</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">規範</th> + <th scope="col">標題</th> + </tr> + <tr> + <td>{{RFC("7725", "451 Unavailable For Legal Reasons")}}</td> + <td>An HTTP Status Code to Report Legal Obstacles</td> + </tr> + </tbody> +</table> + +<h2 id="瀏覽器相容性">瀏覽器相容性</h2> + +<p>The information shown below has been pulled from MDN's GitHub (<a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>).</p> + +<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.status.451")}}</p> + +<h2 id="參見">參見</h2> + +<ul> + <li>{{interwiki("wikipedia", "HTTP_451", "維基百科的 HTTP 451")}}</li> + <li>{{interwiki("wikipedia", "華氏451度", "維基百科的華氏451度")}}(該請求碼的數字詞源)</li> +</ul> diff --git a/files/zh-tw/web/http/status/500/index.html b/files/zh-tw/web/http/status/500/index.html new file mode 100644 index 0000000000..26533581be --- /dev/null +++ b/files/zh-tw/web/http/status/500/index.html @@ -0,0 +1,43 @@ +--- +title: 500 Internal Server Error +slug: Web/HTTP/Status/500 +translation_of: Web/HTTP/Status/500 +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP <code><strong>500 Internal Server Error</strong></code> 伺服器錯誤回應表明了伺服器碰上意外情況,令伺服器無法完成請求。不管你的網站是不是採用 WordPress 系統,任何放在伺服器當中的網頁都有可能發生這種錯誤。</p> + +<p>本錯誤回應屬於通用的「全方位」回應。一般來說,這代碼代表程式無法給出比 500 更適當的回應。有時候,伺服器管理者會針對 500 這樣的錯誤回應,記錄詳細的相關信息,以避免未來出現同樣的錯誤。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox notranslate">500 Internal Server Error</pre> + +<h2 id="規範">規範</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">規範</th> + <th scope="col">標題</th> + </tr> + <tr> + <td>{{RFC("7231", "500 Internal Server Error" , "6.6.1")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</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.status.500")}}</p> + +<h2 id="參考資料">參考資料</h2> + +<ul> + <li><a href="https://techmoon.xyz/500-internal-server-error/" rel="noopener">如何修復 WordPress 出現 500 Internal Server Error 的解決方法</a> +</li> +<li><a href="https://www.exai.com/blog/http-error-500-wordpress" rel="noopener">500 Internal Server Error</a></li> +</ul> diff --git a/files/zh-tw/web/http/status/502/index.html b/files/zh-tw/web/http/status/502/index.html new file mode 100644 index 0000000000..098224da5c --- /dev/null +++ b/files/zh-tw/web/http/status/502/index.html @@ -0,0 +1,57 @@ +--- +title: 502 Bad Gateway +slug: Web/HTTP/Status/502 +tags: + - Bad Gateway + - HTTP + - Status code +translation_of: Web/HTTP/Status/502 +--- +<div>{{HTTPSidebar}}</div> + +<p><code>502 Bad Gateway</code> 錯誤表明伺服器以閘道器或代理訪問時,收到了來自上游服務器的無效回應。</p> + +<div class="note"> +<p><strong>注意:</strong>{{interwiki("wikipedia", "閘道器" )}}可能位於網路上的不同地方。502 錯誤通常也不是開發者可以修復的,他通常需要在要訪問的的伺服器或代理修復之。</p> +</div> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox notranslate">502 Bad Gateway +</pre> + +<h2 id="規範">規範</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">規範</th> + <th scope="col">標題</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{RFC("7231", "502 Bad Gateway" , "6.6.3")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td> + </tr> + </tbody> +</table> + +<h2 id="瀏覽器相容性">瀏覽器相容性</h2> + +<p>The information shown below has been pulled from MDN's GitHub (<a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>).</p> + +<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 class="external" 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.status.502")}}</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="https://techmoon.xyz/502-bad-gateway-error-fix-wordpress/">WordPress 出現 502 Bad Gateway Error 解決方法</a></li> + <li>{{HTTPStatus(504)}}</li> + <li><a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" rel="noopener">HTTP/1.1: Status Code Definition</a></li> + <li><a href="https://www.exai.com/blog/502-bad-gateway">502 bad gateway fix</a></li> + <li><a href="https://kinsta.com/blog/502-bad-gateway/">502 Bad Gateway error on WordPress</a></li> + <li><a href="https://support.cloudflare.com/hc/en-us/articles/115003011431#502504error">502 error with Cloudflare</a></li> +</ul> diff --git a/files/zh-tw/web/http/status/503/index.html b/files/zh-tw/web/http/status/503/index.html new file mode 100644 index 0000000000..dc743f91a4 --- /dev/null +++ b/files/zh-tw/web/http/status/503/index.html @@ -0,0 +1,67 @@ +--- +title: 503 Service Unavailable +slug: Web/HTTP/Status/503 +tags: + - 503 error + - HTTP + - Service Unavailable Error + - Status code +translation_of: Web/HTTP/Status/503 +--- +<div>{{HTTPSidebar}}</div> + +<p>超文本傳輸協定(英文:HyperText Transfer Protocol (HTTP) ) <code><strong>503 Service Unavailable</strong></code> 表示目前伺服器暫時不能處理連線的請求。</p> + +<p>起因通常是伺服器正在進行維護或是當下流量過載。這種錯誤回傳應該是暫時性的,並且{{HTTPHeader("Retry-After")}} HTTP header 中要盡可能描述到系統大概恢復正常的時間。.</p> + +<div class="note"> +<p><strong>注意:回傳這種錯誤的同時,也要同時顯示一張對使用者友善的網頁,來簡單描述問題。</strong></p> +</div> + +<p>回傳此錯誤時,務必注意和快取存取相關的標頭(Caching-related headers),因為 503 狀態通常要是暫時性的,而這種回應不應該被暫存至快取。</p> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox">503 Service Unavailable</pre> + +<h2 id="規範">規範</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">規範</th> + <th scope="col">標題</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{RFC("7231", "503 Service Unavailable" , "6.6.4")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td> + </tr> + </tbody> +</table> + +<h2 id="瀏覽器相容性">瀏覽器相容性</h2> + +<p>以下資訊是從 MDN 的 GitHub 取得 (<a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>).</p> + +<p class="hidden">本頁面的相容性列表示從資料中產生的。如果您想要參與改進,看看 <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> 並且送出 pull 請求。</p> + +<p>{{Compat("http.status.503")}}</p> + +<h2 id="請參閱">請參閱</h2> + +<ul> + <li>{{HTTPHeader("Retry-After")}}</li> +</ul> + +<h2 id="了解更多">了解更多</h2> + +<h3 id="一般知識">一般知識</h3> + +<ul> + <li><a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP/1.1: Status Code Definitions</a></li> + <li><a href="https://kinsta.com/blog/http-error-503/">HTTP Error 503</a></li> + <li><a href="https://secure.wphackedhelp.com/blog/503-service-unavailable-error-wordpress/">503 Service Unvailaible WordPress</a></li> + <li><a href="https://techmoon.xyz/503-service-unavailable-error/">如何修復在 WordPress 當中「503 Service Unavailable Error」的問題?</a></li> +</ul> diff --git a/files/zh-tw/web/http/status/504/index.html b/files/zh-tw/web/http/status/504/index.html new file mode 100644 index 0000000000..c71e30f768 --- /dev/null +++ b/files/zh-tw/web/http/status/504/index.html @@ -0,0 +1,46 @@ +--- +title: 504 Gateway Timeout +slug: Web/HTTP/Status/504 +translation_of: Web/HTTP/Status/504 +--- +<div>{{HTTPSidebar}}</div> + +<p><code><strong>504 Gateway Timeout</strong></code> 錯誤表明伺服器以閘道器或代理訪問時,並沒有上游伺服器即時收到完成請求所需的回應。</p> + +<div class="note"> +<p><strong>注意:</strong>{{interwiki("wikipedia", "閘道器" )}}可能位於網路上的不同地方。502 錯誤通常也不是開發者可以修復的,通常需要在要訪問的的伺服器或代理修復之。</p> +</div> + +<h2 id="狀態">狀態</h2> + +<pre class="syntaxbox notranslate">504 Gateway Timeout</pre> + +<h2 id="規範">規範</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">規範</th> + <th scope="col">標題</th> + </tr> + <tr> + <td>{{RFC("7231", "504 Gateway Timeout" , "6.6.4")}}</td> + <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td> + </tr> + </tbody> +</table> + +<h2 id="瀏覽器相容性">瀏覽器相容性</h2> + +<p>The information shown below has been pulled from MDN's GitHub (<a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>).</p> + +<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.status.504")}}</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" rel="noopener">HTTP/1.1: Status Code Definitions</a></li> + <li>{{HTTPStatus(502)}}</li> +</ul> diff --git a/files/zh-tw/web/http/status/index.html b/files/zh-tw/web/http/status/index.html new file mode 100644 index 0000000000..cb47ff712d --- /dev/null +++ b/files/zh-tw/web/http/status/index.html @@ -0,0 +1,191 @@ +--- +title: HTTP 狀態碼 +slug: Web/HTTP/Status +translation_of: Web/HTTP/Status +--- +<div>{{HTTPSidebar}}</div> + +<p><span class="seoSummary">HTTP 狀態碼表明一個 <a href="/zh-TW/docs/Web/HTTP">HTTP</a> 要求是否已經被完成。回應分為五種:</span></p> + +<ol> + <li class="summary"><span class="seoSummary">資訊回應 (Informational responses, <code>100</code>–<code>199</code>),</span></li> + <li class="summary"><span class="seoSummary">成功回應 (Successful responses, <code>200</code>–<code>299</code>),</span></li> + <li class="summary"><span class="seoSummary">重定向 (Redirects, <code>300</code>–<code>399</code>),</span></li> + <li class="summary"><span class="seoSummary">用戶端錯誤 (Client errors, <code>400</code>–<code>499</code>),</span></li> + <li class="summary"><span class="seoSummary">伺服器端錯誤 (Server errors, <code>500</code>–<code>599</code>).</span></li> +</ol> + +<p class="summary">以下的狀態碼定義在 <a href="https://tools.ietf.org/html/rfc2616#section-10">section 10 of RFC 2616</a> 中。你可以在 <a href="https://tools.ietf.org/html/rfc7231#section-6.5.1">RFC 7231</a> 查看更新過的規範。</p> + +<div class="blockIndicator note"> +<p class="summary">如果你收到任何不在清單內的回應,那很可能伺服器自行軟體實作的非標準規範。</p> +</div> + +<h2 id="資訊回應">資訊回應</h2> + +<dl> + <dt>{{HTTPStatus(100, "100 Continue")}}</dt> + <dd>此臨時回應表明,目前為止的一切完好,而用戶端應當繼續完成請求、或是在已完成請求的情況下,忽略此資訊。</dd> + <dt>{{HTTPStatus(101, "101 Switching Protocol")}}</dt> + <dd>此狀態碼乃為用戶端 {{HTTPHeader("Upgrade")}} 請求標頭發送之回應、且表明伺服器亦切換中。</dd> + <dt>{{HTTPStatus(102, "102 Processing")}} ({{Glossary("WebDAV")}})</dt> + <dd>此狀態碼表明伺服器收到並處理請求中,但目前未有回應。</dd> + <dt>{{HTTPStatus(103, "103 Early Hints")}}</dt> + <dd>此狀態碼主要與 {{HTTPHeader("Link")}} 標頭有關:它能讓用戶代理(user agent)能在伺服器準備回應前能 <a href="/zh-TW/docs/Web/HTML/Preloading_content">preloading</a> 資源。</dd> +</dl> + +<h2 id="成功回應">成功回應</h2> + +<dl> + <dt>{{HTTPStatus(200, "200 OK")}}</dt> + <dd>請求成功。成功的意義依照 HTTP 方法而定:<br> + GET:資源成功獲取並於訊息主體中發送。<br> + HEAD:entity 標頭已於訊息主體中。<br> + POST:已傳送訊息主體中的 resource describing the result of the action。<br> + TRACE:伺服器已接收到訊息主體內含的請求訊息。</dd> + <dt>{{HTTPStatus(201, "201 Created")}}</dt> + <dd>請求成功且新的資源成功被創建,通常用於 POST 或一些 PUT 請求後的回應。</dd> + <dt>{{HTTPStatus(202, "202 Accepted")}}</dt> + <dd>此請求已經被接受但尚未處理。此狀態為非承諾性,代表 HTTP 無法在之後傳送一個非同步的回應告知請求的處理結果。最初<span class="tlid-translation translation" lang="zh-TW"><span title="">目的為外部程序或其他伺服器處理</span></span>請求的情況,或用於批次處理中。</dd> + <dt>{{HTTPStatus(203, "203 Non-Authoritative Information")}}</dt> + <dd>此回應碼表示回傳的中介資料集與並非與原始伺服器上的有效確定集合完全相同,而是來自本地或第三方的副本。除此情況外,200 OK 回應碼應該被優先使用。</dd> + <dt>{{HTTPStatus(204, "204 No Content")}}</dt> + <dd>There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones.</dd> + <dt>{{HTTPStatus(205, "205 Reset Content")}}</dt> + <dd>This response code is sent after accomplishing request to tell user agent reset document view which sent this request.</dd> + <dt>{{HTTPStatus(206, "206 Partial Content")}}</dt> + <dd>This response code is used because of range header sent by the client to separate download into multiple streams.</dd> + <dt>{{HTTPStatus(207, "207 Multi-Status")}} ({{Glossary("WebDAV")}})</dt> + <dd>A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate.</dd> + <dt>{{HTTPStatus(208, "208 Multi-Status")}} ({{Glossary("WebDAV")}})</dt> + <dd>Used inside a DAV: propstat response element to avoid enumerating the internal members of multiple bindings to the same collection repeatedly.</dd> + <dt>{{HTTPStatus(226, "226 IM Used")}} (<a href="https://tools.ietf.org/html/rfc3229">HTTP Delta encoding</a>)</dt> + <dd>The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance.</dd> +</dl> + +<h2 id="重定向訊息">重定向訊息</h2> + +<dl> + <dt>{{HTTPStatus(300, "300 Multiple Choice")}}</dt> + <dd>請求擁有一個以上的回應。用戶代理或使用者應該從中選一。不過,並沒有標準的選擇方案。</dd> + <dt>{{HTTPStatus(301, "301 Moved Permanently")}}</dt> + <dd>此回應碼的意思是,請求資源的 URI 已被改變。有時候,會在回應內給予新的 URI。</dd> + <dt>{{HTTPStatus(302, "302 Found")}}</dt> + <dd>This response code means that URI of requested resource has been changed <em>temporarily</em>. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.</dd> + <dt>{{HTTPStatus(303, "303 See Other")}}</dt> + <dd>Server sent this response to directing client to get requested resource to another URI with an GET request.</dd> + <dt>{{HTTPStatus(304, "304 Not Modified")}}</dt> + <dd>This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response.</dd> + <dt><code>305 Use Proxy</code> {{deprecated_inline}}</dt> + <dd>在舊版本的 HTTP 規範中,表示請求資源必須透過代理存取。基於對代理的頻內設置 (in-band configuration) 相關的安全考量,該狀態碼已棄用。</dd> + <dt><code>306 unused</code></dt> + <dd>該狀態碼已不再被使用,僅被保留。該狀態碼曾在先前得的 HTTP 1.1 規範中被使用。</dd> + <dt>{{HTTPStatus(307, "307 Temporary Redirect")}}</dt> + <dd>伺服器發送此回應來使客戶端保持請求方法不變向新的地址發出請求。 與 <code>302 Found</code> 相同,差別在於客戶端不許變更請求方法。例如,應使用另一個 <code>POST</code> 請求來重複發送 <code>POST</code> 請求。</dd> + <dt>{{HTTPStatus(308, "308 Permanent Redirect")}}</dt> + <dd>This means that the resource is now permanently located at another URI, specified by the <code>Location:</code> HTTP Response header. This has the same semantics as the <code>301 Moved Permanently</code> HTTP response code, with the exception that the user agent <em>must not</em> change the HTTP method used: if a <code>POST</code> was used in the first request, a <code>POST</code> must be used in the second request.</dd> +</dl> + +<h2 id="用戶端錯誤回應">用戶端錯誤回應</h2> + +<dl> + <dt>{{HTTPStatus(400, "400 Bad Request")}}</dt> + <dd>此回應意味伺服器因為收到無效語法,而無法理解請求。</dd> + <dt>{{HTTPStatus(401, "401 Unauthorized")}}</dt> + <dd>需要授權以回應請求。它有點像 403,但這裡的授權,是有可能辦到的。</dd> + <dt>{{HTTPStatus(402, "402 Payment Required")}} {{experimental_inline}}</dt> + <dd>此回應碼留作未來使用。一開始此碼旨在用於數位交易系統,然而,目前極少被使用,且不存在標準或慣例。</dd> + <dt>{{HTTPStatus(403, "403 Forbidden")}}</dt> + <dd>用戶端並無訪問權限,例如未被授權,所以伺服器拒絕給予應有的回應。不同於 401,伺服端知道用戶端的身份。</dd> + <dt>{{HTTPStatus(404, "404 Not Found")}}</dt> + <dd>伺服器找不到請求的資源。因為在網路上它很常出現,這回應碼也許最為人所悉。</dd> + <dt>{{HTTPStatus(405, "405 Method Not Allowed")}}</dt> + <dd>伺服器理解此請求方法,但它被禁用或不可用。有兩個強制性方法:<code>GET</code> 與 <code>HEAD</code>,永遠不該被禁止、也不該回傳此錯誤碼。</dd> + <dt>{{HTTPStatus(406, "406 Not Acceptable")}}</dt> + <dd>This response is sent when the web server, after performing <a href="/zh-TW/docs/HTTP/Content_negotiation#Server-driven_negotiation">server-driven content negotiation</a>, doesn't find any content following the criteria given by the user agent.</dd> + <dt>{{HTTPStatus(407, "407 Proxy Authentication Required")}}</dt> + <dd>This is similar to 401 but authentication is needed to be done by a proxy.</dd> + <dt>{{HTTPStatus(408, "408 Request Timeout")}}</dt> + <dd>This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message.</dd> + <dt>{{HTTPStatus(409, "409 Conflict")}}</dt> + <dd>表示請求與伺服器目前狀態衝突</dd> + <dt>{{HTTPStatus(410, "410 Gone")}}</dt> + <dd>This response would be sent when requested content has been deleted from server.</dd> + <dt>{{HTTPStatus(411, "411 Length Required")}}</dt> + <dd>伺服器拒絕該請求,因為 <code>Content-Length</code> 頭沒有被定義,然而伺服器要求。</dd> + <dt>{{HTTPStatus(412, "412 Precondition Failed")}}</dt> + <dd>The client has indicated preconditions in its headers which the server does not meet.</dd> + <dt>{{HTTPStatus(413, "413 Payload Too Large")}}</dt> + <dd>請求的實體資料大小超過了伺服器定義的上限,伺服器會關閉連接或返回一個 <code>Retry-After</code> 回應頭。</dd> + <dt>{{HTTPStatus(414, "414 URI Too Long")}}</dt> + <dd>客戶端的 URI 請求超過伺服器願意解析的長度。</dd> + <dt>{{HTTPStatus(415, "415 Unsupported Media Type")}}</dt> + <dd>被請求資源的多媒體類型不被伺服器支援,因此該請求被拒絕。</dd> + <dt>{{HTTPStatus(416, "416 Requested Range Not Satisfiable")}}</dt> + <dd>The range specified by the <code>Range</code> header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's data.</dd> + <dt>{{HTTPStatus(417, "417 Expectation Failed")}}</dt> + <dd>This response code means the expectation indicated by the <code>Expect</code> request header field can't be met by the server.</dd> + <dt>{{HTTPStatus(418, "418 I'm a teapot")}}</dt> + <dd>The server refuses the attempt to brew coffee with a teapot.</dd> + <dt>{{HTTPStatus(421, "421 Misdirected Request")}}</dt> + <dd>The request was directed at a server that is not able to produce a response. This can be sent by a server that is not configured to produce responses for the combination of scheme and authority that are included in the request URI.</dd> + <dt>{{HTTPStatus(422, "422 Unprocessable Entity")}} ({{Glossary("WebDAV")}})</dt> + <dd>The request was well-formed but was unable to be followed due to semantic errors.</dd> + <dt>{{HTTPStatus(423, "423 Locked")}} ({{Glossary("WebDAV")}})</dt> + <dd>被訪問的資源被鎖定。</dd> + <dt>{{HTTPStatus(424, "424 Failed Dependency")}} ({{Glossary("WebDAV")}})</dt> + <dd>由於先前的請求失敗導致此請求失敗。</dd> + <dt>{{HTTPStatus(426, "426 Upgrade Required")}}</dt> + <dd>The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol. The server sends an {{HTTPHeader("Upgrade")}} header in a 426 response to indicate the required protocol(s).</dd> + <dt>{{HTTPStatus(428, "428 Precondition Required")}}</dt> + <dd>The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.</dd> + <dt>{{HTTPStatus(429, "429 Too Many Requests")}}</dt> + <dd>用戶在給定的時間內 ("rate limiting") 發送了過多的請求。</dd> + <dt>{{HTTPStatus(431, "431 Request Header Fields Too Large")}}</dt> + <dd>伺服器不願意處理該請求,因為標頭欄位過大。該請求可能可以在減少請求標頭欄位大小後重新提交。</dd> + <dt>{{HTTPStatus(451, "451 Unavailable For Legal Reasons")}}</dt> + <dd>用戶端請求違法的資源,例如受政府審查的網頁。</dd> +</dl> + +<h2 id="伺服器端錯誤回應">伺服器端錯誤回應</h2> + +<dl> + <dt>{{HTTPStatus(500, "500 Internal Server Error")}}</dt> + <dd>伺服器端發生未知或無法處理的錯誤。</dd> + <dt>{{HTTPStatus(501, "501 Not Implemented")}}</dt> + <dd>The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are <code>GET</code> and <code>HEAD</code>.</dd> + <dt>{{HTTPStatus(502, "502 Bad Gateway")}}</dt> + <dd>This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.</dd> + <dt>{{HTTPStatus(503, "503 Service Unavailable")}}</dt> + <dd>The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the <code>Retry-After:</code> HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.</dd> + <dt>{{HTTPStatus(504, "504 Gateway Timeout")}}</dt> + <dd>This error response is given when the server is acting as a gateway and cannot get a response in time.</dd> + <dt>{{HTTPStatus(505, "505 HTTP Version Not Supported")}}</dt> + <dd>請求使用的 HTTP 版本不被伺服器支援。</dd> + <dt>{{HTTPStatus(506, "506 Variant Also Negotiates")}}</dt> + <dd>The server has an internal configuration error: transparent content negotiation for the request results in a circular reference.</dd> + <dt>{{HTTPStatus(507, "507 Insufficient Storage")}}</dt> + <dd>The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.</dd> + <dt>{{HTTPStatus(508, "508 Loop Detected")}} ({{Glossary("WebDAV")}})</dt> + <dd>The server detected an infinite loop while processing the request.</dd> + <dt>{{HTTPStatus(510, "510 Not Extended")}}</dt> + <dd>Further extensions to the request are required for the server to fulfill it.</dd> + <dt>{{HTTPStatus(511, "511 Network Authentication Required")}}</dt> + <dd>The 511 status code indicates that the client needs to authenticate to gain network access.</dd> +</dl> + +<h2 id="瀏覽器相容性">瀏覽器相容性</h2> + + + +<p>{{Compat("http.status")}}</p> + +<h2 id="參見">參見</h2> + +<ul> + <li><a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes">List of HTTP status codes on Wikipedia</a></li> + <li><a href="http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml">IANA official registry of HTTP status codes</a></li> +<li><a href="https://www.exai.com/blog/http-status-codes-cheat-sheet">HTTP Status Codes Cheat Sheet</a></li> + <li><a href="https://kinsta.com/blog/http-status-codes/">A Complete Guide and List of HTTP Status Codes</a></li> + <li><a href="https://techmoon.xyz/httpstatus/">httpstatus – 檢查網址重定向路徑、請求標頭與 HTTP 狀態代碼</a></li> +</ul> |