Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
具有许多数据的Python httplib2 POST方法_Python_Post - Fatal编程技术网

具有许多数据的Python httplib2 POST方法

具有许多数据的Python httplib2 POST方法,python,post,Python,Post,我使用httplib2发布https。但我的脚本出现错误“400错误请求:需要以下参数:用户名、作用域、密码、客户端id”。虽然我通过了足够多的参数。下面是我的脚本: >>> from httplib2 import Http >>> from urllib import urlencode >>> h = Http() >>> data = dict(client_id="x.y.z",username="user

我使用httplib2发布https。但我的脚本出现错误“400错误请求:需要以下参数:用户名、作用域、密码、客户端id”。虽然我通过了足够多的参数。下面是我的脚本:

 >>> from httplib2 import Http
 >>> from urllib import urlencode
 >>> h = Http()
 >>> data = dict(client_id="x.y.z",username="user",password="xxxxxxx",scope="store",access_token_only="1",for_username="1x2xdddzz",for_credential_type="facebook")
 >>> resp, content = h.request("https://someserver.com/authorize", "POST", urlencode(data))
 >>> content
    '400 Bad Request : Following arguments are required: username, scope, password, client_id 
"

我已经搜索过了,但是没有解决这个问题的方法。如果你遇到同样的问题,请给我一个解决方案


谢谢您的帮助

您是否尝试传递所需的参数?用户名、作用域、密码、客户端ID响应中有什么?你有权访问服务器的日志吗?@maurelio79。我尝试了4个参数:用户名、作用域、密码、客户端,但仍然存在。@bvidal,resp:resp{'status':'400','content length':'513','access control expose headers':'Date','vary':'Accept Encoding','server':'CherryPy/3.1.2','content Encoding':'gzip','Date':'Thu,2014年1月9日18:07:54 GMT','access control allow origin':'','access control allow methods':'','content type':'text/html'}有什么“怪异”吗您发送的参数中可能会截断发送到服务器的数据的字符?