如何解决执行post API时将500错误作为响应
在实际代码中,从外部函数为具有无值的字典的数据成员分配值。
向上述URL发送请求时,获得500个错误代码作为响应。
os.environ['http_proxy'] = "http://127.0.0.1:8888"
os.environ['https_proxy'] = "http://127.0.0.1:8888"
headers = {
'Content-Length': "1000",'Content-Type': 'application/json','User-Agent': "Mozilla/5.0 (Linux; Android 5.1; en-us; A5 Build/LMY47I) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/33.0.1750 Mobile Safari/537.36",'Host': 't.appsflyer.com','Connection': 'Keep-Alive','Accept-Encoding': 'gzip'
}
params = {
'buildnumber':"3.7",'app_id' : 'kr.co.company.hwahae'
}
data = {
'device': None,'firstLaunchDate': "2018-05-11_1726+0530",'installDate': "2018-05-11_1652+0530",'sdk': None,'referrer': "utm_source=(not%20set)&utm_medium=(not%20set)",'carrier': None,'deviceFingerPrintId': "ffffffff-c43e-0f72-0000-0000554b5f2f",'date1': "2018-05-11_1652+0530",'af_preinstalled': "false",'advertiserIdEnabled': "true",'iaecounter': "0",'lang_code': "en",'appsflyerKey': "vyrpAMjHsud67YVPR5ZK4S",'installer_package': "com.android.vending",'app_version_name': "3.11.2",'lang': "English",'timepassedsincelastlaunch': "23",'dkh': "vyrpAMjH",'advertiserId': "3487698f-5e5b-447a-b79f-77bebd0be996",'isGaidWithGps': "true",'deviceType': None,'af_v': None,'app_version_code': "120",'af_events_api': "1",'platformextension': "android_native",'network': None,'operator': "",'country': None,'date2': "2018-05-11_1652+0530",'brand': None,'af_timestamp': "1526039807811",'uid': "1526037747370-5406320771079142546",'isFirstCall': "false",'counter': "2",'model': None,'product': None
}
url = 'https://t.appsflyer.com/api/v4/androidevent'
requests.post(url,data = params,headers = headers,proxies = os.environ)
我是python的新手,不胜感激。
预先感谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。