411 が発生する主な原因
- 本文のある POST や PUT で、Content-Length を送らなかった
対処法
- Content-Length ヘッダーを付けて送る
411 を返す・確認する方法
| 環境 | コード |
|---|---|
| 確認(curl) | curl -I https://example.com/path |
| Node.js(Express) | res.status(411).send(...) |
| Python(FastAPI) | raise HTTPException(status_code=411) |
| PHP | http_response_code(411); |
| nginx | return 411; |