We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c6ead5d + 1f3c2d4 commit 8f8d8a7Copy full SHA for 8f8d8a7
Roadmap/20 - PETICIONES HTTP/python/avcenal.py
@@ -10,8 +10,10 @@
10
11
url = "https://retosdeprogramacion.com"
12
response = get(url)
13
-#print(response.content.decode("utf-8").replace(">",">\n")) se podría dar formato a los bytes que recoge la llamada
14
-print(response.content)
+if response.status_code == 200:
+ print(response.text.replace(">",">\n")) #doy formato a la respuesta
15
+else:
16
+ print(f"Error, código: {response.status_code}")
17
18
"""
19
* DIFICULTAD EXTRA (opcional):
0 commit comments