def STS():
'''Accepts players score submitions and passes its info over to ServiceScore funtion to validate the token and then update the teams score when its valid.
json data should be in format {"TeamID": "Highlander","Token": "therecanbeonlyone"}
Example:
curl -H "Content-Type: application/json" -X POST -d '{"TeamID": "Highlander","Token": "therecanbeonlyone"}' http://localhost:5001/ScoreTokentSubmit/
'''
try:
sts_resp = request.data
Token = sts_resp.get('Token')
TeamID = sts_resp.get('TeamID')
if Token and TeamID is not None:
print('Team ' + TeamID + 'has scored service points!')
ServiceScore(TeamID, Token)
return {'request data': request.data}
else:
return {'Invalid': 'request'}
except:
return {'Invalid': 'request'}
评论列表
文章目录