Free2BoxFree2Box

HTTP 狀態碼

所有 HTTP 狀態碼及其含義的快速參考

61 / 61 status codes

1xx 資訊
4 status codes
100

Continue

The server has received the request headers and the client should proceed to send the request body.

101

Switching Protocols

The requester has asked the server to switch protocols and the server has agreed to do so.

102

Processing

The server has received and is processing the request, but no response is available yet.

103

Early Hints

Used to return some response headers before final HTTP message.

2xx 成功
10 status codes
200

OK

The request has succeeded. The meaning depends on the HTTP method used.

201

Created

The request has been fulfilled and a new resource has been created.

202

Accepted

The request has been accepted for processing, but the processing has not been completed.

203

Non-Authoritative Information

The returned metadata is not exactly the same as available from the origin server.

204

No Content

The server successfully processed the request but is not returning any content.

205

Reset Content

The server successfully processed the request and is asking the requester to reset the document view.

206

Partial Content

The server is delivering only part of the resource due to a range header sent by the client.

207

Multi-Status

The message body contains multiple status codes for multiple independent operations.

208

Already Reported

The members of a DAV binding have already been enumerated in a previous reply.

226

IM Used

The server has fulfilled a request for the resource, and the response represents one or more instance-manipulations.

3xx 重定向
8 status codes
300

Multiple Choices

The request has more than one possible response. The user should choose one of them.

301

Moved Permanently

The URL of the requested resource has been changed permanently. The new URL is given in the response.

302

Found

The URI of the requested resource has been changed temporarily. Further changes might be made in the future.

303

See Other

The server sent this response to direct the client to get the requested resource at another URI with a GET request.

304

Not Modified

The resource has not been modified since the last request. The client can use the cached version.

305

Use Proxy

The requested resource must be accessed through the proxy given by the Location field. (Deprecated)

307

Temporary Redirect

The server sends this response to redirect the client with the same HTTP method as the prior request.

308

Permanent Redirect

The resource is permanently located at another URI, specified by the Location header. Same method must be used.

4xx 用戶端錯誤
28 status codes
400

Bad Request

The server cannot or will not process the request due to something perceived to be a client error.

401

Unauthorized

The client must authenticate itself to get the requested response. Similar to 403 but authentication is possible.

402

Payment Required

Reserved for future use. Originally created for digital payment systems.

403

Forbidden

The client does not have access rights to the content. Unlike 401, the client's identity is known to the server.

404

Not Found

The server cannot find the requested resource. This is the most common error response on the web.

405

Method Not Allowed

The request method is known by the server but is not supported by the target resource.

406

Not Acceptable

The server cannot produce a response matching the list of acceptable values defined in the request headers.

407

Proxy Authentication Required

The client must first authenticate itself with the proxy.

408

Request Timeout

The server would like to shut down this unused connection. Sent on an idle connection by some servers.

409

Conflict

The request conflicts with the current state of the server.

410

Gone

The content has been permanently deleted from the server, with no forwarding address.

411

Length Required

The server rejected the request because the Content-Length header field is not defined.

412

Precondition Failed

The client has indicated preconditions in its headers which the server does not meet.

413

Payload Too Large

The request entity is larger than limits defined by the server.

414

URI Too Long

The URI requested by the client is longer than the server is willing to interpret.

415

Unsupported Media Type

The media format of the requested data is not supported by the server.

416

Range Not Satisfiable

The range specified by the Range header field in the request cannot be fulfilled.

417

Expectation Failed

The expectation indicated by the Expect request header field cannot be met by the server.

418

I'm a Teapot

The server refuses the attempt to brew coffee with a teapot. (RFC 2324, an April Fools' joke)

422

Unprocessable Entity

The request was well-formed but was unable to be followed due to semantic errors.

423

Locked

The resource that is being accessed is locked.

424

Failed Dependency

The request failed because it depended on another request and that request failed.

425

Too Early

The server is unwilling to risk processing a request that might be replayed.

426

Upgrade Required

The server refuses to perform the request using the current protocol but might be willing to after the client upgrades.

428

Precondition Required

The origin server requires the request to be conditional to prevent lost update conflicts.

429

Too Many Requests

The user has sent too many requests in a given amount of time (rate limiting).

431

Request Header Fields Too Large

The server is unwilling to process the request because its header fields are too large.

451

Unavailable For Legal Reasons

The user agent requested a resource that cannot legally be provided.

5xx 伺服器錯誤
11 status codes
500

Internal Server Error

The server has encountered a situation it does not know how to handle.

501

Not Implemented

The request method is not supported by the server and cannot be handled.

502

Bad Gateway

The server acting as a gateway got an invalid response from the upstream server.

503

Service Unavailable

The server is not ready to handle the request. Common causes are maintenance or overload.

504

Gateway Timeout

The server acting as a gateway did not get a response in time from the upstream server.

505

HTTP Version Not Supported

The HTTP version used in the request is not supported by the server.

506

Variant Also Negotiates

The server has an internal configuration error: transparent content negotiation results in a circular reference.

507

Insufficient Storage

The server is unable to store the representation needed to complete the request.

508

Loop Detected

The server detected an infinite loop while processing the request.

510

Not Extended

Further extensions to the request are required for the server to fulfill it.

511

Network Authentication Required

The client needs to authenticate to gain network access (e.g., captive portal).

使用方法

1

開啟工具

無需設定——工具在瀏覽器中即時載入。

2

互動與探索

使用滑鼠、鍵盤或觸控即時互動。

3

隨時隨地使用

桌面與行動裝置皆可使用——隨時隨地練習或創作。

為什麼使用此工具

100% 免費

沒有隱藏費用,沒有付費等級——所有功能完全免費。

無需安裝

完全在瀏覽器中運行。無需下載或安裝任何軟體。

隱私且安全

您的資料永遠不會離開您的裝置。不會上傳至任何伺服器。

支援行動裝置

完全響應式設計——在手機、平板或桌面電腦上均可使用。

開發者工具指南

HTTP 狀態碼完全指南:理解伺服器的每個回應

重點摘要

  • 1xx 資訊、2xx 成功、3xx 重新導向、4xx 客戶端錯誤、5xx 伺服器錯誤
  • 200 OK、301 永久重新導向、404 找不到、500 伺服器錯誤是最常見的狀態碼
  • 正確使用 HTTP 狀態碼是 RESTful API 設計的基本要求

HTTP 狀態碼是伺服器對客戶端請求的標準回應。每個三位數的代碼都有特定的含義,幫助客戶端理解請求的處理結果。無論是 API 開發、SEO 優化還是網站除錯,正確理解 HTTP 狀態碼都是不可或缺的知識。

63 個

IANA 註冊的 HTTP 狀態碼數量

重要概念

1

2xx 成功

200 OK(成功)、201 Created(已建立)、204 No Content(無內容回傳)。RESTful API 中,POST 建立資源應回傳 201,DELETE 成功應回傳 204。

2

3xx 重新導向

301 永久重新導向(SEO 權重轉移)、302 暫時重新導向、304 Not Modified(快取有效)。SEO 中域名遷移應使用 301。

3

4xx 客戶端錯誤

400 Bad Request(格式錯誤)、401 Unauthorized(未認證)、403 Forbidden(無權限)、404 Not Found(找不到)、429 Too Many Requests(限速)。

4

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),來自愚人節玩笑但已被正式納入。

本工具所有運算皆在您的瀏覽器本地完成,不會上傳任何資料至伺服器。內容僅供參考,請依實際需求進行驗證。

常見問題