mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
refactor: dumps request body if it is in json format, display indented json in html report
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user