import zlib
import requests

URL = 'http://api.pokersnowie.com:8085/snowieapi'
#URL = 'http://localhost:8085/snowieapi'

if __name__ == "__main__":
    j = """{"API_name": "evaluatePosition","token": "XXXXXXXXX", "clientId": "1", "clientEmail": "yyyyyyy@xxxxxxxxx", "subTierId": "1", "subTierDesc": "1", "hand": {"headsUp": "false", "noSmallBlind": "false","players": [{"id": 1,"startingAmount": 288.0,"blindOutOfTurn": "false","cards": []}, {"id": 2, "startingAmount": 248.0, "blindOutOfTurn": "false", "cards": []}, {"id": 3,"startingAmount": 132.0,"blindOutOfTurn": "false","cards": [{"rank": 12, "color": 1}, {"rank": 7, "color": 1}]}, {"id": 4, "startingAmount": 170.0, "blindOutOfTurn": "false", "cards": []}, {"id": 5, "startingAmount": 483.0, "blindOutOfTurn": "false", "cards": []}, {"id": 7, "startingAmount": 608.0, "blindOutOfTurn": "false", "cards": []}, {"id": 8, "startingAmount": 597.0, "blindOutOfTurn": "false", "cards": []}],"moves": [{"actionId": 1, "playerId": 5, "move": 0, "amount": 0}, {"actionId": 2, "playerId": 7, "move": 1, "amount": 4}, {"actionId": 3, "playerId": 8, "move": 0, "amount": 0}, {"actionId": 4, "playerId": 1, "move": 1, "amount": 4}, {"actionId": 5, "playerId": 2, "move": 0, "amount": 0}, {"actionId": 6, "playerId": 3, "move": 1, "amount": 2}, {"actionId": 7, "playerId": 4, "move": 1, "amount": 0}, {"actionId": 8, "playerId": 3, "move": 1, "amount": 0}, {"actionId": 9, "playerId": 4, "move": 1, "amount": 0}, {"actionId": 10, "playerId": 7, "move": 2, "amount": 602}, {"actionId": 11, "playerId": 1, "move": 1, "amount": 282}],"communityCards": [{"rank": 10, "color": 2}, {"rank": 8, "color": 1}, {"rank": 10, "color": 1}],"ante": 2.0,"straddle": 1,"sb": 1,"bb": 2}}"""
    data = zlib.compress(str(j).encode('UTF-8'))
    r = requests.post(url=URL, data=data)
    print(zlib.decompress(r.content).decode('utf-8'))