def get_access_token(request):
request_url = ‘https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=’+ APPID +’&secret=’ + SECERT
print(request_url)
res = requests.get(request_url)
TOKEN = json.loads(res.content.decode(‘utf-8’))[‘access_token’]
post_url = ‘https://api.weixin.qq.com/datacube/getweanalysisappidvisitpage?access_token=’ + TOKEN
data = {
“begin_date”: “20170313”,
“end_date”: “2017031”
}
headers = {
‘content-type’: ‘application/json’
}
rest = requests.post(post_url,headers=headers,data=data)
print(rest.content)
return JsonResponse({‘code’:200})
这样为什么请求不到数据