From e5f6c8d6bf987cd45019feb743a868da4c2adb35 Mon Sep 17 00:00:00 2001 From: Eugene Ventimiglia Date: Fri, 20 Jan 2023 07:01:10 -0500 Subject: [PATCH] Update py_tutorial.md return should return a tuple with status code --- docs/base/py_tutorial.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/base/py_tutorial.md b/docs/base/py_tutorial.md index 31d7153..bb79e1b 100644 --- a/docs/base/py_tutorial.md +++ b/docs/base/py_tutorial.md @@ -61,7 +61,7 @@ def create_user(): "hometown": hometown }) - return jsonify(user, 201) + return jsonify(user), 201 ``` #### Request @@ -100,7 +100,7 @@ If we tie a `GET` request to the `/users` path with a param giving a user id (i. @app.route("/users/") def get_user(key): user = db.get(key) - return user if user else jsonify({"error": "Not found"}, 404) + return user if user else jsonify({"error": "Not found"}), 404 ``` #### Request @@ -172,7 +172,7 @@ We can tie a `DELETE` request to the path `/users/{id}` to delete a given user r @app.route("/users/", methods=["DELETE"]) def delete_user(key): db.delete(key) - return jsonify({"status": "ok"}, 200) + return jsonify({"status": "ok"}), 200 ``` #### Request