Thanks to visit codestin.com
Credit goes to developer.mozilla.org

此頁面由社群從英文翻譯而來。了解更多並加入 MDN Web Docs 社群。

View in English Always switch to English

303 See Other

HTTP 303 See Other 重新導向回應狀態碼表示瀏覽器應該根據 Location 標頭中的 URL 進行重新導向,而不是連結到所請求的資源本身。

這個回應碼通常作為 PUTPOST 方法的結果發送回來,讓用戶端可以取得確認頁面,或查看真實世界物件的表示(參見 HTTP range-14)。用於取得重新導向資源的方法總是 GET

狀態

http
303 See Other

範例

表單送出時的 303 回應

此範例中,用戶端以 POST 請求提交表單至一個通用的訂閱服務。

http
POST /subscribe HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 50

name=Brian%20Smith&email=brian.smith%40example.com

伺服器可能會回傳 303 狀態碼的回應,並在 Location 標頭中指定確認頁面,讓使用者在收到回應後被重新導向至該頁面。

http
HTTP/1.1 303 See Other
Location: https://www.example.com/confirmation/event/123
Content-Type: text/html; charset=UTF-8
Content-Length: 0

規範

Specification
HTTP Semantics
# status.303

參見