def matchmaker_request(url, token, method, content_type=None, accept=None, data=None):
headers = Headers()<EOL>headers = { '<STR_LIT>': token}<EOL>if content_type:<EOL><INDENT>headers['<STR_LIT:Content-Type>'] = content_type<EOL><DEDENT>if accept:<EOL><INDENT>headers['<STR_LIT>'] = accept<EOL><DEDENT>req_data = data or {'<STR_LIT>' : datetime.datetime.now().timestamp()}<EOL>json_response = None<EOL>try:<EOL><INDENT>LOG.info('<STR_LIT>'.format(<EOL>method, url, req_data))<EOL>resp = requests.request(<EOL>method = method,<EOL>url = url,<EOL>headers = headers,<EOL>data = json.dumps(req_data)<EOL>)<EOL>json_response = resp.json()<EOL>LOG.info('<STR_LIT>'.format(json_response))<EOL>if isinstance(json_response, str):<EOL><INDENT>json_response = {<EOL>'<STR_LIT:message>' : json_response,<EOL>}<EOL><DEDENT>elif isinstance(json_response, list): <EOL><INDENT>return json_response<EOL><DEDENT>json_response['<STR_LIT>'] = resp.status_code<EOL><DEDENT>except Exception as err:<EOL><INDENT>LOG.info('<STR_LIT>'.format(err))<EOL>json_response = {<EOL>'<STR_LIT:message>' : str(err)<EOL>}<EOL><DEDENT>return json_response<EOL>
Send a request to MatchMaker and return its response

    Args:
        url(str): url to send request to
        token(str): MME server authorization token
        method(str): 'GET', 'POST' or 'DELETE'
        content_type(str): MME request Content-Type
        accept(str): accepted response
        data(dict): eventual data to send in request

    Returns:
        json_response(dict): server response