随笔 - 64  文章 - 5 评论 - 23 阅读 - 64051
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

11 2021 档案
UnicodeEncodeError: 'latin-1' codec can't encode character '\u7801' in position 49: Body ('码') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8. 请求body里面有 汉字
摘要:主要原因是 请求body里面有 汉字,没有进行untf-8编码导致,解决方法,对data进行 encode()编码 即可res=requests.post(url,headers=heder,data=indatafengz) 改成 这样即可 res=requests.post(url,header 阅读全文
posted @ 2021-11-04 19:40 fxh嘟嘟 阅读(183) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示