HTTPステータスコード リファレンス - HTTPレスポンスコード一覧 オンライン
すべてのHTTPステータスコード(1xx-5xx)を説明、ユースケース、レスポンス例付きで検索、フィルタリング、コピー。インタラクティブリファレンス — 100%クライアントサイド、サーバーにデータは送信されません。
61件のステータスコード
The server is switching protocols as requested by the client.
The server has received and is processing the request, but no response is available yet.
Used to return response headers before the final HTTP message.
The request succeeded.
The request succeeded and a new resource was created.
The request has been accepted for processing, but processing is not complete.
The returned metadata is not exactly the same as available from the origin server.
The server successfully processed the request but is not returning any content.
The server successfully processed the request and asks the client to reset the document view.
The server is delivering only part of the resource due to a range header sent by the client.
The message body contains multiple status codes for different operations.
The members of a DAV binding have already been enumerated in a previous reply.
The server has fulfilled a GET request for the resource with instance manipulations applied.
The request has more than one possible response.
The URL of the requested resource has been changed permanently.
The URI of requested resource has been changed temporarily.
The server sent this response to direct the client to get the requested resource at another URI with a GET request.
The resource has not been modified since the version specified by the request headers.
The server sends this response to redirect the client, guaranteeing the same HTTP method will be used.
The resource has been permanently moved, and the same HTTP method must be used.
The server cannot process the request due to something perceived to be a client error.
The client must authenticate itself to get the requested response.
Reserved for future use. Originally created for digital payment systems.
The client does not have access rights to the content.
The server cannot find the requested resource.
The request method is known by the server but is not supported by the target resource.
The server cannot produce a response matching the list of acceptable values defined in the request headers.
The client must first authenticate itself with the proxy.
The server timed out waiting for the request.
The request conflicts with the current state of the server.
The content has been permanently deleted from the server with no forwarding address.
The server rejects the request because the Content-Length header field is not defined.
The client has indicated preconditions in its headers which the server does not meet.
The request entity is larger than limits defined by the server.
The URI requested by the client is longer than the server is willing to interpret.
The media format of the requested data is not supported by the server.
The range specified by the Range header field in the request cannot be fulfilled.
The expectation given in the Expect request header could not be met by the server.
The server refuses the attempt to brew coffee with a teapot.
The request was directed at a server that is not able to produce a response.
The request was well-formed but was unable to be followed due to semantic errors.
The resource that is being accessed is locked.
The request failed because it depended on another request that failed.
The server is unwilling to risk processing a request that might be replayed.
The server refuses to perform the request using the current protocol.
The origin server requires the request to be conditional.
The user has sent too many requests in a given amount of time (rate limiting).
The server is unwilling to process the request because its header fields are too large.
The user agent requested a resource that cannot legally be provided.
The server has encountered a situation it does not know how to handle.
The request method is not supported by the server and cannot be handled.
The server got an invalid response while working as a gateway.
The server is not ready to handle the request.
The server is acting as a gateway and cannot get a response in time.
The HTTP version used in the request is not supported by the server.
The server has an internal configuration error during content negotiation.
The server is unable to store the representation needed to complete the request.
The server detected an infinite loop while processing the request.
Further extensions to the request are required for the server to fulfill it.
The client needs to authenticate to gain network access.
よくある質問
HTTPステータスコードとは何ですか?
HTTPステータスコードは、クライアントのリクエストに対してWebサーバーが返す3桁の数字です。リクエストが成功したか、リダイレクトされたか、エラーが発生したかを示します。ステータスコードは5つのクラスに分類されます:1xx(情報)、2xx(成功)、3xx(リダイレクション)、4xx(クライアントエラー)、5xx(サーバーエラー)。IETFのRFC 9110で定義されており、Webの動作の基本です。
このHTTPステータスコード参照ツールはどのように使用しますか?
検索バーにステータスコード番号(例:'404')やキーワード(例:'not found'や'redirect')を入力すると、関連するコードを即座に見つけることができます。1xx〜5xxボタンを使用してカテゴリでフィルタリングすることもできます。ステータスコードカードをクリックすると、詳細な説明、一般的な使用例、コピー可能なレスポンス例が表示されます。コピーボタンを使用して、プロジェクトに必要なコードやスニペットをすばやく取得できます。
データは安全ですか?サーバーに送信されるものはありますか?
このツールは100%クライアントサイドで動作します。すべてのHTTPステータスコードデータはページに静的に埋め込まれており、APIコール、サーバーリクエスト、データ収集は一切ありません。検索クエリやインタラクションがブラウザの外に出ることはありません。初回のページ読み込み後は完全にオフラインで動作します。
401 Unauthorizedと403 Forbiddenの違いは何ですか?
401 Unauthorizedは、リクエストに有効な認証資格情報がないことを意味します。クライアントが自身を識別していない状態です。サーバーは「あなたが誰かわかりません。認証してください」と言っています。403 Forbiddenは、サーバーがあなたが誰かを知っている(認証済みかもしれない)が、そのリソースにアクセスする権限がないことを意味します。サーバーは「あなたが誰かはわかっていますが、許可されていません」と言っています。
301と308リダイレクトの違いは何ですか?
どちらも永続的なリダイレクトを示します。301 Moved Permanentlyはリダイレクト時にHTTPメソッドの変更を許可します(例:POSTがGETに変わる可能性があります)。308 Permanent Redirectは元のHTTPメソッドを保持します。POST/PUTを使用するAPIの場合、308がより安全な選択です。同様に302と307の関係も同じです:302 Foundはメソッド変更を許可し、307 Temporary Redirectはメソッドを保持します。
418 'I'm a teapot'ステータスコードはなぜ存在するのですか?
418 I'm a teapotは、1998年にエイプリルフールのジョークとしてRFC 2324でHyper Text Coffee Pot Control Protocol(HTCPCP)の一部として定義されました。標準の観点からは実際のHTTPステータスコードではありませんが、イースターエッグとして広く採用されており、多くのHTTPライブラリやフレームワークで認識されています。完全性のためにこのリファレンスに含まれています。
WebDAVステータスコードとは何ですか?
WebDAV(Web Distributed Authoring and Versioning)は、クライアントがリモートWebコンテンツのオーサリングを行えるようにするHTTPの拡張です。207 Multi-Status、422 Unprocessable Content、423 Locked、424 Failed Dependency、507 Insufficient Storage、508 Loop Detectedなどの追加ステータスコードを導入しています。これらのコードはRFC 4918で定義されており、現代のREST APIで一般的に使用されています(特にバリデーションエラーに422が使用されます)。
コード例
// HTTP Status Code lookup
const HTTP_STATUS_CATEGORIES = {
'1xx': 'Informational',
'2xx': 'Success',
'3xx': 'Redirection',
'4xx': 'Client Error',
'5xx': 'Server Error',
};
function getStatusCategory(code) {
if (code >= 100 && code < 200) return '1xx';
if (code >= 200 && code < 300) return '2xx';
if (code >= 300 && code < 400) return '3xx';
if (code >= 400 && code < 500) return '4xx';
if (code >= 500 && code < 600) return '5xx';
return 'Unknown';
}
const STATUS_CODES = {
200: 'OK',
201: 'Created',
204: 'No Content',
301: 'Moved Permanently',
302: 'Found',
304: 'Not Modified',
400: 'Bad Request',
401: 'Unauthorized',
403: 'Forbidden',
404: 'Not Found',
405: 'Method Not Allowed',
409: 'Conflict',
422: 'Unprocessable Content',
429: 'Too Many Requests',
500: 'Internal Server Error',
502: 'Bad Gateway',
503: 'Service Unavailable',
};
async function fetchWithStatusHandling(url, options = {}) {
try {
const response = await fetch(url, options);
const category = getStatusCategory(response.status);
switch (category) {
case '2xx':
if (response.status === 204) return { data: null, status: 204 };
return { data: await response.json(), status: response.status };
case '4xx':
const clientError = await response.json().catch(() => ({}));
throw {
status: response.status,
statusText: STATUS_CODES[response.status] || response.statusText,
message: clientError.message || `Client error: ${response.status}`,
isRetryable: response.status === 429,
retryAfter: response.headers.get('Retry-After'),
};
case '5xx':
throw {
status: response.status,
statusText: STATUS_CODES[response.status] || response.statusText,
message: `Server error: ${response.status}`,
isRetryable: [502, 503, 504].includes(response.status),
};
default:
throw new Error(`Unexpected status code: ${response.status}`);
}
} catch (error) {
if (error.status) throw error;
throw { status: 0, message: 'Network error', isRetryable: true };
}
}