【发布时间】:2012-01-07 18:01:24
【问题描述】:
我在 python 2.7 中遇到了关于 urlencode 的问题:
>>> import urllib
>>> import json
>>> urllib.urlencode(json.dumps({'title':"hello world!",'anonymous':False,'needautocategory':True}))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/urllib.py", line 1280, in urlencode
raise TypeError
TypeError: not a valid non-string sequence or mapping object
【问题讨论】:
标签: python json urlencode python-2.7