在使用 Bitbucket REST API 时,如果需要传递多个查询参数,需要使用 '&' 符号进行连接,而不是使用多个 '?' 符号。下面是示例代码:
import requests
api_endpoint = 'https://api.bitbucket.org/2.0/repositories'
params = {
'name': 'example-repo',
'visibility': 'public',
'fork_policy': 'no_forks'
}
response = requests.get(api_endpoint, params=params)
print(response.json())
在上述代码中,我们将三个查询参数传递给 Bitbucket REST API,使用了 '&' 符号进行连接。这样就可以正确处理多个查询参数了。