refactor: dumps request body if it is in json format, display indented json in html report

This commit is contained in:
debugtalk
2019-12-17 21:52:48 +08:00
parent 80cdcd3318
commit aa253338b6
2 changed files with 8 additions and 1 deletions

View File

@@ -4,7 +4,8 @@
**Changed**
- refactor: dumps request and response headers/body, display indented json in report
- refactor: dumps request/response headers, display indented json in html report
- refactor: dumps request/response body if it is in json format, display indented json in html report
## 2.4.3 (2019-12-16)

View File

@@ -153,6 +153,12 @@ def __stringify_request(request_data):
"""
for key, value in request_data.items():
if key == "body":
try:
value = json.loads(value)
except json.decoder.JSONDecodeError:
pass
if isinstance(value, (list, dict)):
value = dumps_json(value)