如何将表单数据的唯一键发布到像站点本身这样的服务器上
In [1]: from requests import Request
In [2]: req = Request('POST', 'http://www.google.com', data={'json':''}).prepare()
In [3]: req.headers, req.body
Out[3]:
({'Content-Length': '5', 'Content-Type': 'application/x-www-form-urlencoded'},
'json=')
In [4]: req = Request('POST', 'http://www.google.com', data={'json':None}).prepare()
In [5]: req.headers, req.body
Out[5]: ({'Content-Type': 'application/x-www-form-urlencoded'}, '')
“Content Length”不能等于键的长度,如4。 那么,如何使body等于“json”?全部thx
从the documentation:
在您的情况下,这意味着:
相关问题 更多 >
编程相关推荐