使用python3.5.1执行post请求时,一直报错"POST data should be bytes or an iterable of bytes. It cannot be of type str.",仔细对照教程后也未发现编写方法没有问题。
最后通过交流发现需要加在urlencode语句后加encode(encoding='UTF8')
eg:
params = urllib.parse.urlencode({'userid':'381fccbd776c4deb'}).encode(encoding='UTF8')
问题解决
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)