【发布时间】:2015-06-03 09:30:04
【问题描述】:
我尝试了this,this,但对我帮助不大,得到同样的错误仍然知道是什么导致了下面代码中的问题。
try:
request = urllib.request.Request(url,data=payload,method='PUT',headers={'Content-Type': 'application/json'})
response = urllib.request.urlopen(request)
except Exception as e:
print(str(e))
得到错误:- 应该为类型类 'dict' 的可迭代数据指定 Content-Length
Python 版本:3.4
我认为问题应该早在 Python 3.2 here 中报告的那样解决
【问题讨论】:
标签: python python-3.4