202 が使われる場面
- 時間のかかる処理(バッチ処理や動画の変換など)を非同期で開始した
202 を返す・確認する方法
| 環境 | コード |
|---|---|
| 確認(curl) | curl -I https://example.com/path |
| Node.js(Express) | res.status(202).send(...) |
| Python(FastAPI) | raise HTTPException(status_code=202) |
| PHP | http_response_code(202); |
| nginx | return 202; |
関連するステータスコード
- 201 Created(作成完了):リクエストが成功し、新しいリソースが作成されたことを示します。