baidu-bce-auth 0.0.5

Last updated:

0 purchases

baidu-bce-auth 0.0.5 Image
baidu-bce-auth 0.0.5 Images
Add to Cart

Description:

baidubceauth 0.0.5

baidu-bce-auth
帮助你生成百度云 API 的鉴权认证字符串(Authorization header)
百度云 API 鉴权认证的文档:https://cloud.baidu.com/doc/Reference/s/njwvz1yfu
使用方法,以 requests 为例
from bceauth.auth import make_auth

ak = 'xxx'
sk = 'yyy'
path = 'zzz'
url = 'http://example.com'
params = {}

requests.get(
url,
params=params,
headers={
'Authorization': make_auth( # <== 调用 make_auth,得到 Authorization 的内容
ak=ak,
sk=sk,
method='GET',
path=path,
params=params,
headers={
'Host': 'example.com',
},
),
'Host': 'example.com',
}
)

完整的例子,可以参考:tests/test_auth.py

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.