Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Update py_tutorial.md #730

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/base/py_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def create_user():
"hometown": hometown
})

return jsonify(user, 201)
return jsonify(user), 201
```

#### Request
Expand Down Expand Up @@ -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/<key>")
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
Expand Down Expand Up @@ -172,7 +172,7 @@ We can tie a `DELETE` request to the path `/users/{id}` to delete a given user r
@app.route("/users/<key>", methods=["DELETE"])
def delete_user(key):
db.delete(key)
return jsonify({"status": "ok"}, 200)
return jsonify({"status": "ok"}), 200
```

#### Request
Expand Down