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/05-returning-json/README.es.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,18 @@ Las REST APIs tienen que retornar datos en formato JSON, no en formato HTML.
5
5
Puedes usar la función [flask jsonify](https://flask.palletsprojects.com/en/1.1.x/api/#flask.json.jsonify) para convertir con facilidad cualquier tipo de datos básico a JSON de esta forma:
6
6
7
7
```python
8
-
defhello_world():
9
-
# supongamos que tienes some_data (cierta información) en una variable json
8
+
# añade el método jsonify a tu importación de Flask
9
+
from flask import Flask, jsonify
10
+
11
+
# supongamos que tienes tus datos en la variable some_data
0 commit comments