#接口類型:互億無線實名認(rèn)證接口
#賬戶注冊:https://user.ihuyi.com/register.html
#注意事項:
#DEMO僅作參考
#此為python3版本
import requests
import json
import time
import hashlib
#接口地址
url = 'https://api.ihuyi.com/idcard/Submit.json'
account = 'APPID'
password = 'APPKEY'
app = 'id2m' #固定值
name = '15db57aa314529aaa0fbe95b3e95bd3' #明文:張三
id_card_no = '9efebb3d7d059bff092842bf31dd2816' #明文:123456789012345678
_now = str(int(time.time()))
password_raw = account + password + app + name + id_card_no + _now
# print(password_raw)
password_md5 = hashlib.md5(password_raw.encode(encoding='UTF-8')).hexdigest()
# print(password)
#定義請求的數(shù)據(jù)
data = {
'account':account,
# 'password':password,
'password':password_md5,
'app':app,
'name':name,
'id_card_no':id_card_no,
'time':_now,
}
#定義請求的頭部
headers = {
"Content-type": "application/x-www-form-urlencoded",
"Accept": "text/plain"
}
#發(fā)起請求
response = requests.post(url, headers=headers, data=data)
#打印結(jié)果
print(response.content.decode())
驗證碼已發(fā)送到您的手機,請查收!
輸入驗證碼后,點擊“開通體驗賬戶”按鈕可立即開通體驗賬戶。