diff --git a/src/aioweb/preview.py b/src/aioweb/preview.py index 3435e54..e50db7c 100644 --- a/src/aioweb/preview.py +++ b/src/aioweb/preview.py @@ -36,8 +36,9 @@ class RequestPreview: if self.details["data"] is not None: data = self.details["data"] # aiohttp form-encodes a dict data= body (application/x-www-form-urlencoded); - # render that wire form, not the python repr, so the curl replays identically - rendered = urlencode(data) if isinstance(data, dict) else str(data) + # render that wire form, not the python repr, so the curl replays identically. + # doseq=True mirrors aiohttp's FormData: a list value becomes repeated k=v pairs + rendered = urlencode(data, doseq=True) if isinstance(data, dict) else str(data) parts.append(f"--data {shlex.quote(rendered)}") elif self.details["json"] is not None: # is-not-None: an empty-but-valid body ({} / []) must still render