HTTP 狀態碼
所有 HTTP 狀態碼及其含義的快速參考
61 / 61 status codes
Continue
The server has received the request headers and the client should proceed to send the request body.
Switching Protocols
The requester has asked the server to switch protocols and the server has agreed to do so.
Processing
The server has received and is processing the request, but no response is available yet.
Early Hints
Used to return some response headers before final HTTP message.
OK
The request has succeeded. The meaning depends on the HTTP method used.
Created
The request has been fulfilled and a new resource has been created.
Accepted
The request has been accepted for processing, but the processing has not been completed.
Non-Authoritative Information
The returned metadata is not exactly the same as available from the origin server.
No Content
The server successfully processed the request but is not returning any content.
Reset Content
The server successfully processed the request and is asking the requester to reset the document view.
Partial Content
The server is delivering only part of the resource due to a range header sent by the client.
Multi-Status
The message body contains multiple status codes for multiple independent operations.
Already Reported
The members of a DAV binding have already been enumerated in a previous reply.
IM Used
The server has fulfilled a request for the resource, and the response represents one or more instance-manipulations.
Multiple Choices
The request has more than one possible response. The user should choose one of them.
Moved Permanently
The URL of the requested resource has been changed permanently. The new URL is given in the response.
Found
The URI of the requested resource has been changed temporarily. Further changes might be made in the future.
See Other
The server sent this response to direct the client to get the requested resource at another URI with a GET request.
Not Modified
The resource has not been modified since the last request. The client can use the cached version.
Use Proxy
The requested resource must be accessed through the proxy given by the Location field. (Deprecated)
Temporary Redirect
The server sends this response to redirect the client with the same HTTP method as the prior request.
Permanent Redirect
The resource is permanently located at another URI, specified by the Location header. Same method must be used.
Bad Request
The server cannot or will not process the request due to something perceived to be a client error.
Unauthorized
The client must authenticate itself to get the requested response. Similar to 403 but authentication is possible.
Payment Required
Reserved for future use. Originally created for digital payment systems.
Forbidden
The client does not have access rights to the content. Unlike 401, the client's identity is known to the server.
Not Found
The server cannot find the requested resource. This is the most common error response on the web.
Method Not Allowed
The request method is known by the server but is not supported by the target resource.
Not Acceptable
The server cannot produce a response matching the list of acceptable values defined in the request headers.
Proxy Authentication Required
The client must first authenticate itself with the proxy.
Request Timeout
The server would like to shut down this unused connection. Sent on an idle connection by some servers.
Conflict
The request conflicts with the current state of the server.
Gone
The content has been permanently deleted from the server, with no forwarding address.
Length Required
The server rejected the request because the Content-Length header field is not defined.
Precondition Failed
The client has indicated preconditions in its headers which the server does not meet.
Payload Too Large
The request entity is larger than limits defined by the server.
URI Too Long
The URI requested by the client is longer than the server is willing to interpret.
Unsupported Media Type
The media format of the requested data is not supported by the server.
Range Not Satisfiable
The range specified by the Range header field in the request cannot be fulfilled.
Expectation Failed
The expectation indicated by the Expect request header field cannot be met by the server.
I'm a Teapot
The server refuses the attempt to brew coffee with a teapot. (RFC 2324, an April Fools' joke)
Unprocessable Entity
The request was well-formed but was unable to be followed due to semantic errors.
Locked
The resource that is being accessed is locked.
Failed Dependency
The request failed because it depended on another request and that request failed.
Too Early
The server is unwilling to risk processing a request that might be replayed.
Upgrade Required
The server refuses to perform the request using the current protocol but might be willing to after the client upgrades.
Precondition Required
The origin server requires the request to be conditional to prevent lost update conflicts.
Too Many Requests
The user has sent too many requests in a given amount of time (rate limiting).
Request Header Fields Too Large
The server is unwilling to process the request because its header fields are too large.
Unavailable For Legal Reasons
The user agent requested a resource that cannot legally be provided.
Internal Server Error
The server has encountered a situation it does not know how to handle.
Not Implemented
The request method is not supported by the server and cannot be handled.
Bad Gateway
The server acting as a gateway got an invalid response from the upstream server.
Service Unavailable
The server is not ready to handle the request. Common causes are maintenance or overload.
Gateway Timeout
The server acting as a gateway did not get a response in time from the upstream server.
HTTP Version Not Supported
The HTTP version used in the request is not supported by the server.
Variant Also Negotiates
The server has an internal configuration error: transparent content negotiation results in a circular reference.
Insufficient Storage
The server is unable to store the representation needed to complete the request.
Loop Detected
The server detected an infinite loop while processing the request.
Not Extended
Further extensions to the request are required for the server to fulfill it.
Network Authentication Required
The client needs to authenticate to gain network access (e.g., captive portal).
使用方法
開啟工具
無需設定——工具在瀏覽器中即時載入。
互動與探索
使用滑鼠、鍵盤或觸控即時互動。
隨時隨地使用
桌面與行動裝置皆可使用——隨時隨地練習或創作。
為什麼使用此工具
100% 免費
沒有隱藏費用,沒有付費等級——所有功能完全免費。
無需安裝
完全在瀏覽器中運行。無需下載或安裝任何軟體。
隱私且安全
您的資料永遠不會離開您的裝置。不會上傳至任何伺服器。
支援行動裝置
完全響應式設計——在手機、平板或桌面電腦上均可使用。
HTTP 狀態碼完全指南:理解伺服器的每個回應
重點摘要
- 1xx 資訊、2xx 成功、3xx 重新導向、4xx 客戶端錯誤、5xx 伺服器錯誤
- 200 OK、301 永久重新導向、404 找不到、500 伺服器錯誤是最常見的狀態碼
- 正確使用 HTTP 狀態碼是 RESTful API 設計的基本要求
HTTP 狀態碼是伺服器對客戶端請求的標準回應。每個三位數的代碼都有特定的含義,幫助客戶端理解請求的處理結果。無論是 API 開發、SEO 優化還是網站除錯,正確理解 HTTP 狀態碼都是不可或缺的知識。
63 個
IANA 註冊的 HTTP 狀態碼數量
重要概念
2xx 成功
200 OK(成功)、201 Created(已建立)、204 No Content(無內容回傳)。RESTful API 中,POST 建立資源應回傳 201,DELETE 成功應回傳 204。
3xx 重新導向
301 永久重新導向(SEO 權重轉移)、302 暫時重新導向、304 Not Modified(快取有效)。SEO 中域名遷移應使用 301。
4xx 客戶端錯誤
400 Bad Request(格式錯誤)、401 Unauthorized(未認證)、403 Forbidden(無權限)、404 Not Found(找不到)、429 Too Many Requests(限速)。
5xx 伺服器錯誤
500 Internal Server Error(伺服器內部錯誤)、502 Bad Gateway(閘道錯誤)、503 Service Unavailable(服務暫時不可用)、504 Gateway Timeout(閘道逾時)。
實用技巧
401 和 403 的區別:401 是「不知道你是誰」(未認證),403 是「知道你是誰但你沒權限」。
API 設計不要所有錯誤都回 200——使用正確的狀態碼讓客戶端能正確處理各種情況。
429 Too Many Requests 通常搭配 Retry-After 標頭,告訴客戶端何時可以重試。
418 I'm a Teapot 是一個真實存在的狀態碼(RFC 2324),來自愚人節玩笑但已被正式納入。
本工具所有運算皆在您的瀏覽器本地完成,不會上傳任何資料至伺服器。內容僅供參考,請依實際需求進行驗證。