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: exercises/04-response-body-json/README.es.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -22,15 +22,15 @@ Response body:
22
22
}
23
23
```
24
24
25
-
Haga una solicitud GET a ese endpoint e imprime la hora en la consola con este formato:
25
+
1. Haz una solicitud GET a ese endpoint e imprime la hora en la consola con este formato:
26
26
27
27
```bash
28
28
Current time: 17 hrs 06 min and 23 sec
29
29
```
30
30
31
31
## 💡 Pistas:
32
32
33
-
1. Usa el [metodo .json()](https://www.w3schools.com/python/ref_requests_response.asp) para obtener el response body como un diccionario y almacenarlo en una variable.
34
-
2. Obtenga las propiedades `hours`, `minutes` y `seconds` del diccionario.
35
-
3. Concatenar todo de esta manera: `Hora actual: 17 h 06 min y 23 seg`.
33
+
+ Usa el [metodo .json()](https://www.w3schools.com/python/ref_requests_response.asp) para obtener el response body como un diccionario y almacenarlo en una variable.
34
+
+ Obtenga las propiedades `hours`, `minutes` y `seconds` del diccionario.
35
+
+ Concatenar todo de esta manera: `Hora actual: 17 h 06 min y 23 seg`.
Copy file name to clipboardExpand all lines: exercises/04-response-body-json/README.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# `04` Response JSON
2
2
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.
3
+
But having a text based response is not very useful, that is why APIs normally respond in CSV, JSON, YAML or XML format.
4
4
5
5
## 📝 Instructions:
6
6
@@ -22,15 +22,15 @@ Response body:
22
22
}
23
23
```
24
24
25
-
Please do a GET request to that endpoint and print the time on the console with this format:
25
+
1.Please do a GET request to that endpoint and print the time on the console with this format:
26
26
27
27
```text
28
28
Current time: 17 hrs 06 min and 23 sec
29
29
```
30
30
31
31
## 💡 Hints:
32
32
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.
35
-
3. Concatenate everything together like this: `Current time: 17 hrs 06 min and 23 sec`.
33
+
+ 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
+
+ Get the `hours`, `minutes` and `seconds` properties from the dictionary.
35
+
+ Concatenate everything together like this: `Current time: 17 hrs 06 min and 23 sec`.
El siguiente endpoint es ideal para recuperar proyectos de estudiantes:
4
4
@@ -8,7 +8,7 @@ GET [https://assets.breatheco.de/apis/fake/sample/project1.php](https://assets.b
8
8
{
9
9
"name": "Coursera eLearning",
10
10
"thumb": "https://unsplash.it/450/320?image=178",
11
-
"description": "The coolest elarning site on the planet",
11
+
"description": "The coolest eLearning site on the planet",
12
12
"images": [
13
13
"https://unsplash.it/450/320?image=178",
14
14
"https://unsplash.it/450/320?image=179",
@@ -18,19 +18,19 @@ GET [https://assets.breatheco.de/apis/fake/sample/project1.php](https://assets.b
18
18
}
19
19
```
20
20
21
-
# 📝 Instrucciones
21
+
##📝 Instrucciones:
22
22
23
-
Llama al endpoint e imprime el nombre del proyecto en el terminal (solo el nombre del proyecto)
23
+
1.Llama al endpoint e imprime el nombre del proyecto en el terminal (solo el nombre del proyecto).
24
24
25
-
Example output:
26
-
```bash
25
+
Ejemplo de salida:
26
+
27
+
```text
27
28
Coursera eLearning
28
29
```
29
30
30
-
## 💡Pista
31
+
## 💡 Pistas:
31
32
32
-
1. Ejercicio similar al anterior.
33
-
2. Haz una solicitud GET al endpoint.
34
-
3. Usa el [metodo .json()](https://www.w3schools.com/python/ref_requests_response.asp) para obtener el response body como un diccionario (igual que lo hizo en el último ejercicio).
35
-
4. Imprime el nombre del proyecto, puedes acceder al nombre de la propiedad en el diccionario de respuestas.
33
+
+ Haz una solicitud GET al endpoint.
34
+
+ Usa el [metodo .json()](https://www.w3schools.com/python/ref_requests_response.asp) para obtener el response body como un diccionario (igual que en el último ejercicio).
35
+
+ Imprime el nombre del proyecto, puedes acceder al nombre de la propiedad en el diccionario de respuestas.
Copy file name to clipboardExpand all lines: exercises/05-project-name/README.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ GET [https://assets.breatheco.de/apis/fake/sample/project1.php](https://assets.b
8
8
{
9
9
"name": "Coursera eLearning",
10
10
"thumb": "https://unsplash.it/450/320?image=178",
11
-
"description": "The coolest elarning site on the planet",
11
+
"description": "The coolest eLearning site on the planet",
12
12
"images": [
13
13
"https://unsplash.it/450/320?image=178",
14
14
"https://unsplash.it/450/320?image=179",
@@ -18,19 +18,19 @@ GET [https://assets.breatheco.de/apis/fake/sample/project1.php](https://assets.b
18
18
}
19
19
```
20
20
21
-
# 📝 Instructions
21
+
##📝 Instructions:
22
22
23
-
Please call the endpoint and print the project name on the terminal (only the project name)
23
+
1.Please call the endpoint and print the project name on the terminal (only the project name).
24
24
25
25
Example output:
26
-
```bash
26
+
27
+
```text
27
28
Coursera eLearning
28
29
```
29
30
30
-
## 💡Hint
31
+
## 💡 Hints:
31
32
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.
33
+
+ Make a GET request to the endpoint.
34
+
+ 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 the last exercise).
35
+
+ Print the project name; you can access the property name in the response dictionary.
Cada uno de los proyectos tiene el siguiente formato (ejemplo):
8
+
8
9
```json
9
10
{
10
11
"name": "Coursera eLearning",
11
12
"thumb": "https://unsplash.it/450/320?image=178",
12
-
"description": "The coolest elarning site on the planet",
13
+
"description": "The coolest eLearning site on the planet",
13
14
"images": [
14
15
"https://unsplash.it/450/320?image=178",
15
16
"https://unsplash.it/450/320?image=179",
@@ -19,22 +20,23 @@ Cada uno de los proyectos tiene el siguiente formato (ejemplo):
19
20
}
20
21
```
21
22
22
-
# 📝 Instrucciones
23
+
## 📝 Instrucciones:
24
+
25
+
1. Llama al endpoint e imprime el nombre del **SEGUNDO** proyecto en la lista:
23
26
24
-
Llame al punto final e imprima el nombre del **SEGUNDO** proyecto en la lista:
27
+
Ejemplo de salida:
25
28
26
-
Ejemplo:
27
-
```bash
29
+
```text
28
30
Coursera eLearning
29
31
```
30
32
31
-
## 💡Pista
33
+
## 💡 Pistas:
32
34
33
-
1. Abre el endpoint en tu navegador y analiza la respuesta que se encuentra en el body, necesitas saber qué esperar, cuál será la estructura de los datos (body response) que regresan del servidor.
34
-
2. En este caso, el body response comienza con un corchete `[`, es una lista, debe acceder al segundo proyecto utilizando posiciones numéricas.
35
-
2. Haga una solicitud GET al endpoint.
36
-
3. Usa el [metodo .json()](https://www.w3schools.com/python/ref_requests_response.asp)para obtener el body response como un diccionario.
37
-
4. Encuentra el segundo proyecto
38
-
5. Imprime el nombre del proyecto, puedes acceder a la propiedad nombre "name" del diccionario del proyecto.
39
-
6. No necesitas hacer un bucle (loop), solo accede al segundo elemento como una lista usando la posición
35
+
+ Abre el endpoint en tu navegador y analiza la respuesta que se encuentra en el body, necesitas saber qué esperar, cuál será la estructura de los datos (response body) que devuelve el servidor.
36
+
+ En este caso, el response body comienza con un corchete `[`, es una lista, debes acceder al segundo proyecto utilizando posiciones numéricas.
37
+
+ Haz una solicitud GET al endpoint.
38
+
+ Usa el [metodo .json()](https://www.w3schools.com/python/ref_requests_response.asp)para obtener el response body como un diccionario.
39
+
+ Encuentra el segundo proyecto de la lista.
40
+
+ Imprime el nombre del proyecto, puedes acceder a la propiedad `name` del diccionario del proyecto.
41
+
+ No necesitas hacer un bucle (loop), solo accede al segundo elemento como una lista usando la posición.
Each of the projects has the following format (example):
8
+
8
9
```json
9
10
{
10
11
"name": "Coursera eLearning",
11
12
"thumb": "https://unsplash.it/450/320?image=178",
12
-
"description": "The coolest elarning site on the planet",
13
+
"description": "The coolest eLearning site on the planet",
13
14
"images": [
14
15
"https://unsplash.it/450/320?image=178",
15
16
"https://unsplash.it/450/320?image=179",
@@ -19,22 +20,22 @@ Each of the projects has the following format (example):
19
20
}
20
21
```
21
22
22
-
# 📝 Instructions
23
+
##📝 Instructions:
23
24
24
-
Please call the endpoint and print the name of the **SECOND** project on the list:
25
+
1.Please call the endpoint and print the name of the **SECOND** project on the list:
25
26
26
27
Example output:
27
-
```bash
28
+
```text
28
29
Coursera eLearning
29
30
```
30
31
31
-
## 💡Hint
32
+
## 💡 Hints:
32
33
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
34
+
+ 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.
35
+
+ In this case, the response body starts with a square bracket `[`, it's a list, and you have to access the second project by using numerical positions.
36
+
+ Make a GET request to the endpoint.
37
+
+ Use the [.json() method](https://www.w3schools.com/python/ref_requests_response.asp) to get the response body as a dictionary.
38
+
+ Find the second project on the list.
39
+
+ Print the project name, you can access the property `name` of the project dictionary.
40
+
+ You don't need to loop, just access the second item like a list using the position.
0 commit comments