diff --git a/httprunner/client.py b/httprunner/client.py index 54f168e1..e1ade62a 100644 --- a/httprunner/client.py +++ b/httprunner/client.py @@ -45,7 +45,14 @@ def get_req_resp_record(resp_obj: Response) -> ReqRespData: request_body = resp_obj.request.body try: request_body = json.loads(request_body) - except (json.JSONDecodeError, UnicodeDecodeError): + except json.JSONDecodeError: + # str: Unexpected UTF-8 BOM (decode using utf-8-sig) + pass + except UnicodeDecodeError: + # bytes/bytearray: request body in protobuf + pass + except TypeError: + # neither str nor bytes/bytearray, e.g. None pass if request_body: