Skip to main content

Generate headers with authorization for the request of TencentCloud Apigateway API.

Project description

tencentcloud-apigateway-authorization

Generate headers with authorization for the request of TencentCloud Apigateway API. 为腾讯云Api网管服务的AP的请求I生成带有authorization认证信息的header

Install

pip install tencentcloud-apigateway-authorization

Use

import os

from apigateway import Auth
import requests

secretId = os.environ['secretId']
secretKey = os.environ['secretKey']
auth = Auth(secretId, secretKey)
headers = auth.generateHeaders()
response = requests.get('https://service-{appid}.ap-shanghai.apigateway.myqcloud.com/release/api', headers=headers)
print(response.json())

Author

Yixian Du

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page