帮助你生成百度云 API 的鉴权认证字符串(Authorization header)
Project description
baidu-bce-auth
帮助你生成百度云 API 的鉴权认证字符串(Authorization header)
百度云 API 鉴权认证的文档:https://cloud.baidu.com/doc/Reference/s/njwvz1yfu
使用方法,以 requests 为例
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file baidu_bce_auth-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: baidu_bce_auth-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 806b4c6a6d712dd68503ea5807df428fb96c646c0e5d84eb27ebaca126204452 |
|
MD5 | 6d314f813f4de9fb2de6bef48aa28d0b |
|
BLAKE2b-256 | be017f3321a6b97d96523ebe05e7d7a1585dce298addbd02bed0c70a3088200e |