HTTPステータスコードリファレンス
HTTPステータスコード一覧
1xx 1xx 情報
2xx 2xx 成功
3xx 3xx リダイレクト
4xx 4xx クライアントエラー
5xx 5xx サーバーエラー
ツールについて
HTTP ステータスコードの検索可能なリファレンス。1xx〜5xx を分類別に表示し、正式名と簡単な説明付きで「422 とは?」「401 と 403 のどちら?」を即座に確認できます。
使い方
- Type a code (404), partial name (gateway), or keyword (auth) into the search box.
- Browse the filtered list grouped by status class.
- Read the canonical name and one-line description for the matching codes.
- Use the colour coding to quickly spot 4xx (client error) vs 5xx (server error).
- Reference the result in your API design, log analysis, or error handling code.
主な使用例
- Choosing the right status code for a new REST API endpoint.
- Investigating a strange status code (e.g., 418, 451) you saw in a server log.
- Deciding between 401 Unauthorized and 403 Forbidden for an auth flow.
- Documenting expected error responses in an OpenAPI / Swagger spec.
- Understanding why a CDN returned 503 vs 504 during an outage.
- Mapping HTTP errors to user-facing error messages with consistent semantics.
よくある質問
Q. When should I return 401 vs 403?
A. 401 means "not authenticated, present credentials"; 403 means "authenticated but not allowed". If the client has no valid session, send 401. If they are logged in but lack permission, send 403.
Q. Is 422 the same as 400?
A. Both are 4xx, but 400 means the request itself is malformed (bad JSON, missing header) while 422 means the request is well-formed but semantically invalid (validation failed).
Q. Should I always use 200 for successful POSTs?
A. 201 Created is more precise when you create a new resource and 204 No Content when you succeed but return no body. 200 is correct when you do return a representation.
Q. What does 429 mean for rate limiting?
A. 429 Too Many Requests signals the client should slow down. Pair it with a Retry-After header so clients know when to try again.