我最近开始了一个项目,其中涉及到我必须连接到会计应用程序的API (Kuali)。我最近才开始使用API,连接到这个服务器有很大的困难。运行以下代码时,我收到以下错误:
import requests
requests.get('https://university.kuali.co/api/v1/auth/authenticate','Authorization: Basic mykeyhere')
print(requests.status_codes)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='university.kuali.co', port=443): Max retries exceeded with url: /api/v1/auth/authenticate?Authorization:%20Basic%20mykeyhere (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x109c276d0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))我将非常感谢任何帮助,因为这个项目将节省我的大量时间。
API文档的链接可以在下面找到。
发布于 2021-11-07 23:26:33
授权应该在headers requests.get(url,headers={“Authorisation”:“Basic your key here”})下面)
https://stackoverflow.com/questions/69877277
复制相似问题