python发短信验证总是失败,那里出问题?{"error":{"code":50002,"message":"auth failed"}}

liusuchao
2019-01-17 15:17 1k 0
# coding=utf-8

import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning

import base64

主帐号

AppKey = "d170c2fbb00ba0db0a3d89f3"

主帐号Token

MasterSecret = "8ad7b0fe9ec24d84**"

应用Id

ServerIP = "https://api.sms.jpush.cn/v1/codes"

src = ''
src = AppKey + ":" + MasterSecret
auth = base64.b64encode(src.encode("utf-8"))
headers = {}
headers['Content-Type'] = 'application/json'
headers['Authorization'] = auth
data_json = {}
data_json["mobile"] = '15920066572'
data_json['sign_id'] = 7053
data_json["temp_id"] = 159641

1个回答

热门排序