解决python接口测试返回json乱码问题,解决如下:

req = requests.post(url="http://192.168.229.128:8080/cms/manage/loginJump.do",
                            data={"userAccount": "admin", "loginPwd": "123456"})
 results = req.json()
 print(json.dumps(results, sort_keys=True, indent=2, separators=(',', ': '), ensure_ascii=False))   
 # indent 是间隔长度,ensure_asccii解决编码问题

                          

你可能感兴趣的:(接口测试)