url = '请求地址'
headers = {'Accept': 'application/json, text/plain, */*',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'zh-CN,zh;q=0.9',
'access-token': 'null',
'Connection': 'keep-alive',
'Host': '域名',
'Referer': '前置请求',
'User-Agent': 'Mozilla (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKi (KHTML, like Gecko) Version Mobile/15A372 Safari;}
data = {
'phone': 用户名,
'password': '密码',
}
try:
res = reque(url=url,headers=headers,data=data).json()
except Exception as e:
# res = '连接错误。'
res = {'code':'500','msg':'连接错误。'}