我在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
Run Code Online (Sandbox Code Playgroud)