import json

import requests

from debug import debug

port = 8451
if debug:
    host = 'http://localhost:' + str(port)
else:
    host = 'http://koljastrohm-games.com:' + str(port)
json_headers = {'Content-type': 'application/json'}


def client_request(route, data):
    if debug:
        print('Sending to Server: ' + str(json.dumps(data)))
    r = requests.post(host + '/' + route, data=json.dumps(data),
                      headers=json_headers)
    if debug:
        print('Request returned: ' + str(r.content))
    return r.json()


session_id = None