This commit is contained in:
Casper V. Kristensen 2019-04-06 19:22:48 +02:00
parent e2c7880ca2
commit 55977d9dc4
Signed by: caspervk
GPG key ID: 289CA03790535054

View file

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