api_catch_all: fix for request.POST debugging

This commit is contained in:
Klaas van Schelven
2025-10-29 17:25:49 +01:00
parent 20e065c6e8
commit 74ace016bc

View File

@@ -231,10 +231,10 @@ def api_catch_all(request, subpath):
if request.GET:
lines.append(f" GET: {request.GET.dict()}")
body = request.body # note: must be above request.POST access to avoid "You cannot access body after reading ..."
if request.POST:
lines.append(f" POST: {request.POST.dict()}")
body = request.body
if body:
try:
decoded = body.decode("utf-8", errors="replace").strip()