414 が発生する主な原因
- 大量のデータを GET のクエリパラメーターに入れた
- リダイレクトのたびにパラメーターが追加され、URL が長くなり続けた
対処法
- 大きなデータは POST の本文で送る
414 を返す・確認する方法
| 環境 | コード |
|---|---|
| 確認(curl) | curl -I https://example.com/path |
| Node.js(Express) | res.status(414).send(...) |
| Python(FastAPI) | raise HTTPException(status_code=414) |
| PHP | http_response_code(414); |
| nginx | return 414; |