Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/339.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请求OAuth2Session()传递多个作用域参数_Python_Oauth 2.0_Python Requests - Fatal编程技术网

Python请求OAuth2Session()传递多个作用域参数

Python请求OAuth2Session()传递多个作用域参数,python,oauth-2.0,python-requests,Python,Oauth 2.0,Python Requests,我已成功授权使用“data_read”作为作用域的API连接,但在将多个作用域参数(“data_read”和“data_write”)传递到OAuth2Session()函数时遇到问题 需要将多个作用域的参数作为 范围=数据读取&范围=数据写入 我尝试使用逗号分隔的列表: scope=[“数据读取”、“数据写入”] 其结果是: 范围=数据读取+数据写入 我还尝试在字典中传递作用域列表: dict_scope = {'scope':["data_read", "data_write"]} 这会导

我已成功授权使用“data_read”作为作用域的API连接,但在将多个作用域参数(“data_read”和“data_write”)传递到OAuth2Session()函数时遇到问题

需要将多个作用域的参数作为

范围=数据读取&范围=数据写入

我尝试使用逗号分隔的列表:

scope=[“数据读取”、“数据写入”]

其结果是:

范围=数据读取+数据写入

我还尝试在字典中传递作用域列表:

dict_scope = {'scope':["data_read", "data_write"]}
这会导致错误:

ValueError: Invalid scope ({'scope': ['data_read', 'data_write']}), must be string, tuple, set, or list.
我在这里查阅了请求文档:

在这里:

和OAuth2示例:

如有任何想法或建议,将不胜感激