code: def dump_json(testcase, json_file):
      
      logging.info("dump testcase to JSON format.")
  
      with io.open(json_file, 'w', encoding="utf-8") as outfile:
          my_json_str = json.dumps(testcase, ensure_ascii=ensure_ascii, indent=4)
          if isinstance(my_json_str, bytes):
              my_json_str = my_json_str.decode("utf-8")
  
          outfile.write(my_json_str)
  
      logging.info("Generate JSON testcase successfully: {}".format(json_file))
docs: dump HAR entries to json testcase