You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .learn/exercises/07-post_todo/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ POST /todos
8
8
DELETE /todos
9
9
```
10
10
11
-
In order to build the `POST /todos` endpoint, we have to do something similar to what we did in the first endpoint with our GET method. Remember that each endpoint in a Flask API is represented by a function ( def my_function(): ) and a decorator ( @app.route() ) like this:
11
+
In order to build the `POST /todos` endpoint, we have to do something similar to what we did in the first endpoint with our GET method. Remember that each endpoint in a Flask API is represented by decorator `@app.route()`and a function `def my_function():` like this:
12
12
13
13
```python
14
14
@app.route('/myroute', methods=['GET'])
@@ -23,7 +23,7 @@ Also, we are expecting to receive the TODO that the client wants to add inside o
23
23
```python
24
24
from flask import request
25
25
26
-
#the request body is already json decoded and it comes in the request.json variable
26
+
#The request body is already JSON decoded, and it comes in the request.json variable
27
27
print(request.json)
28
28
```
29
29
@@ -35,7 +35,7 @@ print(request.json)
35
35
from flask import request
36
36
```
37
37
38
-
2. Then, Add the folowing endpoint to your app.py and test it:
38
+
2. Then, add the following endpoint to your app.py and test it:
0 commit comments