“”
斗地主游戏对局开始锁定积分接口
对接口入参做json及base64转化后,调用接口,入参要求如下
{
“member_ids”: “{[2,3,4]}”,
“record_number”: 175,
“division_id”: 3
}
“”"
import json
import base64
import requests
x=json.dumps("{[2,3,4]}")
z=json.loads(y)
q=json.dumps(z)
a={“member_ids”:q,“record_number”:XXX,“division_id”:XXX}
print(a)
encodestr = base64.b64encode(str(a).encode(‘utf-8’))
print(str(encodestr,‘utf-8’))
url = “http://XXX”
payload =str(encodestr)
headers = {
‘Content-Type’: “application/x-www-form-urlencoded”,
}
response = requests.request(“POST”, url, data=payload, headers=headers)
print(response.text)
接口入参格式处理下
最新推荐文章于 2023-04-28 09:52:51 发布