养蜂场使用jwt认证

2024-03-29 14:44:58 发布

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

我使用以下方法从API获取令牌:

# fetch the token
res = requests.post(url, data={"email": email, "password": password})
token_json = res.json()

# now can use the api
res = requests.post(authenticated_url, headers={
    "Authorization": "Bearer %s" % token_json['access']
}
data = res.json()

我要怎么在养蜂场设置这个?我见过的最接近使用身份验证的方法是this


Tags: the方法tokenapijsonurldataemail