303 が使われる場面
- フォームの送信(POST)後に、完了ページへ転送した(PRG パターン)。再読み込みで二重送信されるのを防げる
303 を返す・確認する方法
| 環境 | コード |
|---|---|
| 確認(curl) | curl -I https://example.com/path |
| Node.js(Express) | res.status(303).send(...) |
| Python(FastAPI) | raise HTTPException(status_code=303) |
| PHP | http_response_code(303); |
| nginx | return 303; |
関連するステータスコード
- 302 Found(発見(一時的な移動)):リソースが一時的に別の URL にあることを示します。