Digikey API访问基于网络的服务器和发送在python中失效的令牌

2024-10-02 08:17:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试用python访问Digikey API。我已经取得了所有的证书。当我访问时,它会断开并显示令牌错误。我不知道。Digikey需要本地应用程序。我使用“localhost”作为应用程序地址。Calling python program that is calling digikey API。一个网页出现,并显示这样的安慰。Web link open write after compiling that python program。你知道吗

任何帮助都将不胜感激。你知道吗

提前谢谢。你知道吗

import os

import digikey

import http.client

conn = http.client.HTTPSConnection("api.digikey.com")

os.environ['DIGIKEY_CLIENT_ID'] = 'xxxxx'

os.environ['DIGIKEY_CLIENT_SECRET'] = 'xxxxx'

os.environ['DIGIKEY_STORAGE_PATH'] = "xxxxx"

dkpn = '296-6501-1-ND'
part = digikey.part(dkpn)

Tags: importclientapi应用程序httpthatosenviron

热门问题