This commit is contained in:
Casper 2019-04-06 19:22:48 +02:00
parent e2c7880ca2
commit 55977d9dc4
No known key found for this signature in database
GPG Key ID: 289CA03790535054

View File

@ -34,11 +34,14 @@ strategies = {
@app.route("/", methods=["GET", "POST"]) @app.route("/", methods=["GET", "POST"])
def probabilities(): def probabilities():
if request.method == 'GET': if request.method == "GET":
logger.warning("GET request: using default context parameters") logger.warning("GET request: using default context parameters")
context = Context()
else:
phone_data = request.get_json(force=True) phone_data = request.get_json(force=True)
logger.debug("phone_data:\n%s", json.dumps(phone_data, indent=2)) logger.debug("phone_data:\n%s", json.dumps(phone_data, indent=2))
context = Context(**phone_data) context = Context(**phone_data["data"])
logger.debug("Context: %s", context) logger.debug("Context: %s", context)
predictions: List[dict] = [] predictions: List[dict] = []