示例,在創建微信公眾號自定義菜單時,程序:
# 創建小程序菜單
def create_public_menu():
# 獲取token
token = get_access_token()
# json 請求數據
payload = {
"button": [
{
"type": "miniprogram",
"name": "小程序",
"url": "https://mp.weixin.qq.com",
"appid": "appid",
"pagepath": "pages/index/index"
}
]
}
res = requests.post('https://api.weixin.qq.com/cgi-bin/menu/create?access_token=%s' % (token,), json=payload)
print(json.dumps(res.json(), ensure_ascii=False, indent=2))
pass
微信公眾平台系統返回錯誤:
{
"errcode": 40033,
"errmsg": "invalid charset. please check your request, if include \\uxxxx will create fail! ri
stay Python in , Except that t
Catalog introduction One 、 R