tool::http-status-detail
204 No Content
The server successfully processed the request but returns no content.
ステータスコード
204
名前
No Content
カテゴリ
2xx詳細説明
HTTP 204 No Contentは、リクエストが正常に処理されたが返すコンテンツがないことを示します。DELETEやPUT/PATCHリクエスト後にレスポンスボディなしで成功を通知する際に主に使用します。ブラウザは204レスポンスを受け取ると現在のページを維持し、リダイレクトは行いません。
主な原因
- ▸DELETEリクエストでリソースを正常に削除した場合
- ▸PUT/PATCHリクエストでリソースを更新したが本文を返さない場合
- ▸CORS OPTIONSプリフライトリクエストへのレスポンス
- ▸フォーム送信後に現在のページ状態を維持したい場合
解決方法
- 1.204は正常なレスポンスのため、修正は不要です
- 2.レスポンスボディが必要な場合は200 OKを使用してください
- 3.作成されたリソース情報が必要な場合は201 Createdを使用してください
- 4.204レスポンスには絶対にボディを含めないでください(HTTP仕様違反)
関連HTTPヘッダー
Cache-ControlETagレスポンス例
HTTP/1.1 204 No Content Cache-Control: no-cache
関連ステータスコード
200OKThe request has succeeded.→201CreatedThe request has been fulfilled and a new resource has been created.→202AcceptedThe request has been accepted but not yet acted upon.→203Non-Authoritative InformationThe response is from a transforming proxy, not the origin server.→205Reset ContentThe server processed the request; the client should reset the document view.→
ad · 300×250
// related tools