You can use the requests library to perform the HTTPS GET request. Here’s the Python code to make the request:
import requests
url = "https://api.weixin.qq.com/cgi-bin/token"
params = {
"grant_type": "client_credential",
"appid": "YOUR_APPID",
"secret": "YOUR_APPSECRET"
}
response = requests.get(url, params=params)
if response.status_code == 200:
print("Request successful!")
print(response.json())
else:
print("Request failed. Status code:", response.status_code)
print(response.text)
Remember to replace YOUR_APPID and YOUR_APPSECRET with your actual AppID and AppSecret, respectively.