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 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