网易云信发送信息配置Python
作者:
垃圾桶边的狗 | 来源:发表于
2019-01-23 20:53 被阅读0次
data参数API
headers参数配置
import hashlib
import time
import uuid
import requests
if __name__ == '__main__':
sms_url = 'https://api.netease.im/sms/sendcode.action'
post_data = {
'mobile':'13383338888'
}
cur_time = str(time.time())
app_secret = 'b836167f3f0'
nonce = str(uuid.uuid4())
# 参数拼接
before = app_secret + nonce + cur_time
# 哈希加密
check_sum = hashlib.new('sha1',before.encode('utf-8')).hexdigest()
headers = {
'AppKey':'5339f046d3cce96c0e427c699740ecc0',
'Nonce':nonce,
'CurTime':cur_time,
'CheckSum':check_sum
}
response = requests.post(sms_url,data=post_data,headers=headers)
print(response.json())
结果

返回结果.png
本文标题:网易云信发送信息配置Python
本文链接:https://www.haomeiwen.com/subject/gpgsjqtx.html
网友评论