|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
fd_data = 'queryParams: {"data":{"dimensions":[],"measures":[{"aggregationType":null,"calcField":false,"caption":"日期" (。。。后面省略一万个字符)
content = session.post(fd_url, data=fd_data, headers=fd_headers).content.decode("utf-8")
print(content)
问题:传递的参数里面有”日期“,导致报错:UnicodeEncodeError: 'latin-1' codec can't encode characters in position 103-104: Body ('日期') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.
尝试过下面这个方法,修改里面的传递的参数编码,导致报错400
content = session.post(fd_url, data=fd_data.encode("utf-8"), headers=fd_headers).content.decode("utf-8")
print(content)
请求各位大佬帮忙看下,万分感谢,百度查了一天了,没查到什么有用的方法。 |
|