def queryExecutorRDB(): if request.method == 'POST': error = validate_sql(request) if error is not None: return error return Response(status=200)
def getModelRDB(): if request.method == 'POST': validation_error = validate_sql(request) if validation_error is not None: return validation_error # Test if client accepts the response content-type: application/json if 'Accept' not in request.headers.keys(): return error(400, "Client must accept content-type application/json") if 'application/json' not in request.headers['ACCEPT']: return error(400, "Client must accept content-type application/json in addition to {0}".format(request.headers['Accept'])) # FIXME: returning mocked results mocked_response = json.load(open('examples/response_catalogue_getModelRDB.json')) return jsonify(mocked_response)