SkyLothar / requests-bce

Baidu BCE using python-request

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BCE using python-requests

Version

v0.0.4

https://img.shields.io/travis/SkyLothar/requests-bce.svg?style=flat-square https://img.shields.io/coveralls/SkyLothar/requests-bce/master.svg?style=flat-square https://requires.io/github/SkyLothar/requests-bce/requirements.svg?branch=master Supported Python versions License

BCE authentication for the awesome requests!

support auth version: v1

  • [x] BCM

How to Install

Just

pip install requests-bce

How to Use

Just pass the auth object to requests

>>> import requests
>>> from bceauth import AuthV1
>>> req = requests.post(
...     "http://example.com/path/to/file",
...     auth=AuthV1("access-key", "secret-key")
... )
<Response [200]>

Or set the auth attribute to the session object

>>> import requests
>>> from bceauth import AuthV1
>>> session = requests.session()
>>> session.auth = AuthV1("access-key", "secret-key")
>>> req = session.get("http://example.com/path/to/file")
<Response [200]>

About

Baidu BCE using python-request

License:Apache License 2.0


Languages

Language:Python 100.0%