def dologin(self):
data = {'username': self.username,
'token': self.token,
'functionName': 'doLogin',
'uuid': UUID,
'request': {'password': self.password}
}
headers = {'UUID': UUID, 'account_type': ACCOUNT_TYPE,
'Content-Type': 'data/gzencode and rsa public encrypt;charset=UTF-8'
}
# ??
post_data = gzencode(json.dumps(data))
# ??
post_data = encrypt(post_data)
# post
resp = requests.post(LOGIN_URL, data=post_data, headers=headers)
ret = json.loads(gzdecode(resp.content[8:]))
if ret['retcode'] == 0:
print u'dologin:', ret['retmsg']
print ret['ucid']
print ret['st']
return ret
评论列表
文章目录