Skip to content

Commit 5b119bd

Browse files
committed
misspells and small issues
1 parent 34f5f16 commit 5b119bd

File tree

10 files changed

+38
-28
lines changed

10 files changed

+38
-28
lines changed

exercises/01-what-is-a-request/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ print(response.status_code)
1414
Change the variable url to make it request to:
1515

1616
```bash
17-
https://assets.breatheco.de/apis/fake/hello.php
17+
https://assets.breatheco.de/apis/fake/sample/hello.php
1818
```
1919

2020
Note: The console should print a 200 status code.

exercises/01-what-is-a-request/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
def test_url(app):
66
with patch('requests.get') as mock_request:
77
app()
8-
url = "https://assets.breatheco.de/apis/fake/hello.php"
8+
url = "https://assets.breatheco.de/apis/fake/sample/hello.php"
99
assert mock_request.call_args.args[0] == url

exercises/02-random-status/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ Create a condition to print on the console the following messages depending on t
1010
| ----- | ----- |
1111
| 404 | The URL you asked is not found |
1212
| 503 | Unavailable right now |
13-
| 200 | Everythign went perfect |
13+
| 200 | Everything went perfect |
1414
| 400 | Something is wrong on the request params |

exercises/02-random-status/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_url_200(capsys, app):
1414
mock_request.return_value.status_code = 200
1515
app()
1616
captured = capsys.readouterr()
17-
assert "Everythign went perfect\n" == captured.out
17+
assert "Everything went perfect\n" == captured.out
1818

1919
@pytest.mark.it("When testing for 404 it should print The URL you asked is not found'")
2020
def test_url_404(capsys, app):

exercises/03-response-body/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ print(response.text)
1111

1212
# 📝 Instructions
1313

14-
Print on the console the response body only for 200 requests, for all the other print "Something wend wrong".
14+
Print on the console the response body only for 200 requests, for all the other print "Something went wrong".
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
# `04` Response JSON
22

3-
But having a text based response is not very usefull, that is why API's normally respond in CSV, JSON, YAML or XML.
3+
But having a text based response is not very useful, that is why API's normally respond in CSV, JSON, YAML or XML format.
44

55
# 📝 Instructions
66

77
The following endpoint returns the current time in a JSON format every time it is requested using the GET method.
88

9-
```python
10-
GET: https://assets.breatheco.de/apis/fake/sample/time.php
9+
| | |
10+
| --- | --- |
11+
| method | GET |
12+
| endpoint | https://assets.breatheco.de/apis/fake/sample/time.php |
13+
| content-type | application/json |
1114

12-
Response body (application/json):
15+
Response body:
1316

17+
```python
1418
{
1519
"hours": "07",
1620
"minutes": "29",
1721
"seconds": "35"
1822
}
1923
```
2024

21-
Please do a GET request to that endpoint and print what the time on the console with this format:
25+
Please do a GET request to that endpoint and print the time on the console with this format:
2226

2327
```bash
2428
Current time: 17 hrs 06 min and 23 sec
2529
```
2630

2731
## 💡Hint
2832

29-
1. Use the [.json() method](https://www.w3schools.com/python/ref_requests_response.asp) to get the response body as a dictionary
30-
2. Get the `hours`, `minutes` and `seconds` properties from the object
33+
1. Use the [.json() method](https://www.w3schools.com/python/ref_requests_response.asp) to get the response body as a dictionary and store it in a variable
34+
2. Get the `hours`, `minutes` and `seconds` properties from the dictionary
3135
3. Concatenate everything together like this: `Current time: 17 hrs 06 min and 23 sec`
3236

exercises/05-project-name/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# `05` Project name
22

3-
The following endpoint is ideal to retrieve student projects:
4-
[https://assets.breatheco.de/apis/fake/sample/project1.php](https://assets.breatheco.de/apis/fake/sample/project1.php)
3+
The following endpoint is ideal to retrieve student projects:
4+
5+
GET [https://assets.breatheco.de/apis/fake/sample/project1.php](https://assets.breatheco.de/apis/fake/sample/project1.php)
56

67
```json
78
{
@@ -21,13 +22,15 @@ The following endpoint is ideal to retrieve student projects:
2122

2223
Please call the endpoint and print the project name on the terminal (only the project name)
2324

25+
Example output:
2426
```bash
2527
Coursera eLearning
2628
```
2729

2830
## 💡Hint
2931

30-
1. Do a GET request to the endpoint.
31-
2. Use the [.json() method](https://www.w3schools.com/python/ref_requests_response.asp) to get the response body as a dictionary.
32-
3. Print the project name, you can access the property name on the response dictionary.
32+
1. Similar exercise to the previous one.
33+
2. Do a GET request to the endpoint.
34+
3. Use the [.json() method](https://www.w3schools.com/python/ref_requests_response.asp) to get the response body as a dictionary (same as you did on last exercise).
35+
4. Print the project name, you can access the property name on the response dictionary.
3336

exercises/06-project-list/README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# `06` Project List
22

3-
The following endpoint returns a JSON formated response with several projects in a list:
4-
[https://assets.breatheco.de/apis/fake/sample/project_list.php](https://assets.breatheco.de/apis/fake/sample/project_list.php)
3+
The following endpoint returns a JSON formated response with several projects in a list:
4+
5+
GET: [https://assets.breatheco.de/apis/fake/sample/project_list.php](https://assets.breatheco.de/apis/fake/sample/project_list.php)
56

67
Each of the projects has the following format (example):
78
```json
@@ -20,7 +21,7 @@ Each of the projects has the following format (example):
2021

2122
# 📝 Instructions
2223

23-
Please call the endpoint and print the name of the SECOND project on the list:
24+
Please call the endpoint and print the name of the **SECOND** project on the list:
2425

2526
Example output:
2627
```bash
@@ -29,9 +30,11 @@ Coursera eLearning
2930

3031
## 💡Hint
3132

32-
1. Do a GET request to the endpoint.
33-
2. Use the [.json() method](https://www.w3schools.com/python/ref_requests_response.asp) to get the response body as a dictionary.
34-
3. Find the second project on the list.
35-
4. Print the project name, you can access the property name of the project dictionary.
36-
5. You don't need to loop, just access the second item like a list using the position
33+
1. Open the endpoint on your browser and analyze the response body, you need to know what to expect, what is going to be the structure of the data (response body) coming back from the server.
34+
2. In this case the response body starts with a square bracket `[`, it's a list, you have to access the second project by using numerical positions.
35+
2. Do a GET request to the endpoint.
36+
3. Use the [.json() method](https://www.w3schools.com/python/ref_requests_response.asp) to get the response body as a dictionary.
37+
4. Find the second project on the list.
38+
5. Print the project name, you can access the property name of the project dictionary.
39+
6. You don't need to loop, just access the second item like a list using the position
3740

exercises/07-project-list-image/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# 📝 Instructions
44

5-
Doing a GET request to the same URL please pring the last image URL of the last project.
5+
Do a GET request to the same URL as in the previous exercise, print the `last` image URL in the `last` project.
66

77
Example output:
88
```bash
@@ -16,5 +16,5 @@ https://image.shutterstock.com/image-vector/trophy-cup-award-vector-icon-260nw-5
1616
3. Find the last project on the list.
1717
4. Find the last image of that project.
1818
5. Print the image URL on the console.
19-
6. You dont need to loop, jsut use the positions (index).
19+
6. No need to loop, just use the numerical positions (index) to access the information
2020

exercises/08-blog-post-author/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Take a moment to understand the response body when doing a GET request to this endpoint:
44
[https://assets.breatheco.de/apis/fake/sample/weird_portfolio.php](https://assets.breatheco.de/apis/fake/sample/weird_portfolio.php)
55

6-
👉🏼 [Here is a brief explanation.](https://www.youtube.com/watch?v=fwfBYVrvSk0)
6+
👉🏼 [Here is a brief video explanation.](https://www.youtube.com/watch?v=fwfBYVrvSk0)
77

88
# 📝 Instructions
99

0 commit comments

Comments
 (0)