Skip to content

Commit 74fb26a

Browse files
authored
Updated README.md
Changed grammar and order of instructions based on class confusion and common questions we had when running into issues. This will eliminate further questions and lead to a better student experience.
1 parent e417c8e commit 74fb26a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.learn/exercises/07-post_todo/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ POST /todos
88
DELETE /todos
99
```
1010

11-
In order to build the `POST /todos` we have to do something similar to what we did in the first endpoint. Remember that each endpoint in a Flask API is represented by a function and a decorator 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 a function ( def my_function(): ) and a decorator ( @app.route() ) like this:
1212

1313
```python
14-
@app.route('/blahblah', methods=['GET'])
14+
@app.route('/myroute', methods=['GET'])
1515
def hello_world():
1616
return 'Hello, World!'
1717
```
1818

19-
Except in this case we are not going to be expecting a GET request.
19+
In this case, we are not going to be expecting a `GET` request, but rather a `POST` request.
2020

2121
Also, we are expecting to receive the TODO that the client wants to add inside of the request body.
2222

@@ -29,7 +29,13 @@ print(request.json)
2929

3030
## 📝 Instructions:
3131

32-
1. Add the folowing endpoint to your app.py and test it:
32+
1. Remember to import request at the top of the file:
33+
34+
```python
35+
from flask import request
36+
```
37+
38+
2. Then, Add the folowing endpoint to your app.py and test it:
3339

3440
```python
3541
@app.route('/todos', methods=['POST'])
@@ -38,9 +44,3 @@ def add_new_todo():
3844
print("Incoming request with the following body", request_body)
3945
return 'Response for the POST todo'
4046
```
41-
42-
2. Remember to import request at the top of the file:
43-
44-
```python
45-
from flask import request
46-
```

0 commit comments

Comments
 (0)