From cfe751539ef5b4f63ea9f3bfefc1224d24a38a7c Mon Sep 17 00:00:00 2001 From: emilys314 Date: Thu, 31 Oct 2024 15:16:57 -0400 Subject: [PATCH] Update /prediction python route to match odh documentation resource --- 0_start_here.ipynb | 4 ++-- 2_test_flask.ipynb | 4 ++-- wsgi.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/0_start_here.ipynb b/0_start_here.ipynb index c545ab7..4cbaf0a 100644 --- a/0_start_here.ipynb +++ b/0_start_here.ipynb @@ -145,7 +145,7 @@ "metadata": {}, "outputs": [], "source": [ - "!curl -X POST -H \"Content-Type: application/json\" --data '{\"data\": \"hello world\"}' http://localhost:5000/predictions\n" + "!curl -X POST -H \"Content-Type: application/json\" --data '{\"data\": \"hello world\"}' http://localhost:5000/prediction\n" ] }, { @@ -156,7 +156,7 @@ "source": [ "import requests\n", "import json\n", - "response = requests.post('http://127.0.0.1:5000/predictions', '{\"hello\":\"world\"}')\n", + "response = requests.post('http://127.0.0.1:5000/prediction', '{\"hello\":\"world\"}')\n", "response.json()" ] }, diff --git a/2_test_flask.ipynb b/2_test_flask.ipynb index a36bbd5..0d77c54 100644 --- a/2_test_flask.ipynb +++ b/2_test_flask.ipynb @@ -28,7 +28,7 @@ "metadata": {}, "outputs": [], "source": [ - "!curl -X POST -H \"Content-Type: application/json\" --data '{\"data\": \"hello world\"}' http://localhost:5000/predictions" + "!curl -X POST -H \"Content-Type: application/json\" --data '{\"data\": \"hello world\"}' http://localhost:5000/prediction" ] }, { @@ -39,7 +39,7 @@ "source": [ "import requests\n", "import json\n", - "response = requests.post('http://127.0.0.1:5000/predictions', '{\"hello\":\"world\"}')\n", + "response = requests.post('http://127.0.0.1:5000/prediction', '{\"hello\":\"world\"}')\n", "response.json()" ] }, diff --git a/wsgi.py b/wsgi.py index d349d93..c6280eb 100644 --- a/wsgi.py +++ b/wsgi.py @@ -11,7 +11,7 @@ def status(): return jsonify({'status': 'ok'}) -@application.route('/predictions', methods=['POST']) +@application.route('/prediction', methods=['POST']) def create_prediction(): data = request.data or '{}' body = json.loads(data)