Skip to main content

帮助你生成百度云 API 的鉴权认证字符串(Authorization header)

Project description

Build Status Coverage Status image image image

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

baidu_bce_auth-0.0.3-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file baidu_bce_auth-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: baidu_bce_auth-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.0 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

Hashes for baidu_bce_auth-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ffbb119d1d3b86fbb3d58a4967179db81ec25071bce53c9794c1cc7f1813df54
MD5 6deee77d0c70fb2d6fb44d5aec1353eb
BLAKE2b-256 ab92777bfb07f0d39900df09d28620e8a3c4b77f6a9023f112b2e714942b7e60

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page