问题描述
python后台查询快递100企业版物流失败,错误详情:{'result': False, 'returnCode': '503', 'message': '验证签名失败'}
问题出现的环境背景及自己尝试过哪些方法
我根据官网构造的发送数据列表:
{'param': '{"com": "yuantong", "num": "806690602241012594"}', 'customer': 'C1A11C5435C78317D73EF4A32A3A1F93', 'sign': 'd9f07754552d93a37c295224a60d46d4'}
sign参数我是已经使用md5方式加密了
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
param_temp = {}
param_temp['com'] = com
param_temp['num'] = num
param_temp = str(param_temp)
m = hashlib.md5() #md5加密
sign_temp = param_temp +key+customer
m.update(sign_temp.encode('utf-8')) # MD5加密必须是byte类型
sign = m.hexdigest()
param = {}
param['param'] = param_temp
param['customer'] = customer
param['sign'] = sign
query = requests.post("https://poll.kuaidi100.com/poll/query.do", param)