diff options
Diffstat (limited to 'files/zh-tw/web/http/status/204')
| -rw-r--r-- | files/zh-tw/web/http/status/204/index.html | 49 |
1 files changed, 49 insertions, 0 deletions
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> |
