@app.route('<STR_LIT>', methods=['<STR_LIT:POST>'])<EOL>def __entry_point():
ip = request.remote_addr<EOL>ua = request.headers.get('<STR_LIT>', '<STR_LIT>')<EOL>method = request.json.get('<STR_LIT>')<EOL>if method is None:<EOL><INDENT>__query_logging(ip, ua, method, level='<STR_LIT>')<EOL>return json.dumps({'<STR_LIT:error>': '<STR_LIT>'})<EOL><DEDENT>if method not in authorized_methods:<EOL><INDENT>__query_logging(ip, ua, method, level='<STR_LIT>')<EOL>return json.dumps({'<STR_LIT:error>': '<STR_LIT>'})<EOL><DEDENT>fct = globals().get(method)<EOL>if fct is None:<EOL><INDENT>__query_logging(ip, ua, method, level='<STR_LIT>')<EOL>return json.dumps({'<STR_LIT:error>': '<STR_LIT>'})<EOL><DEDENT>if request.json.get('<STR_LIT>') is None:<EOL><INDENT>__query_logging(ip, ua, method, level='<STR_LIT>')<EOL>return json.dumps({'<STR_LIT:error>': '<STR_LIT>'})<EOL><DEDENT>try:<EOL><INDENT>result = fct(request.json)<EOL>__query_logging(ip, ua, method, request.json.get('<STR_LIT>'),<EOL>request.json.get('<STR_LIT>'), request.json.get('<STR_LIT>'))<EOL>return result<EOL><DEDENT>except Exception:<EOL><INDENT>__query_logging(ip, ua, method, request.json.get('<STR_LIT>'), level='<STR_LIT:error>')<EOL>return json.dumps({'<STR_LIT:error>': '<STR_LIT>'})<EOL><DEDENT>
Function called when an query is made on /json. Expects a JSON
object with at least a 'method' entry.