Skip to content

Commit 6b4373d

Browse files
committed
Pending changes exported from your codespace
1 parent 8b6eb7b commit 6b4373d

File tree

22 files changed

+145
-81
lines changed

22 files changed

+145
-81
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import requests
2+
3+
url = "https://assets.breatheco.de/apis/fake/sample/random-status.php"
4+
5+
response = requests.get(url)
6+
7+
if response.status_code == 200:
8+
print(response.text)
9+
else:
10+
print("Something went wrong")
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Python API Requests
1+
# `00` Welcome to Python API Requests!
22

33
Python Requests es el paquete mΓ‘s popular para consumir API y hacer solicitudes HTTP.
44

55
AquΓ­ aprenderΓ‘s:
66

77
1. CΓ³mo hacer solicitudes GET.
8-
2. CΓ³mo obtener propiedades de una data e informaciΓ³n.
8+
2. CΓ³mo obtener propiedades de datos e informaciΓ³n.
99
3. CΓ³mo configurar request headers.
1010
4. CΓ³mo configurar request content-type.
1111
5. CΓ³mo hacer solicitudes POST.
1212

13-
Haga click en el botΓ³n `next β†’` en la esquina superior derecha para continuar.
13+
Haga clic en el botΓ³n `Next β†’` en la esquina superior derecha para continuar.

β€Žexercises/00-welcome/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# `00` Welcome to Python API Requests!
2+
3+
Python Requests is the most popular package for consuming APIs and doing HTTP requests.
4+
5+
Here you will learn:
6+
7+
1. How to do GET requests.
8+
2. How to fetch data properties and information.
9+
3. How to set request headers.
10+
4. How to set request content-type.
11+
5. How to do POST requests.
12+
13+
Click the `Next β†’` button on the top right to continue.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# `01` Creating a Request
2+
3+
Python tiene integrado un [paquete de solicitudes (*requests package*)](https://requests.readthedocs.io/en/master/) eso permite a los desarrolladores crear solicitudes HTTP con bastante facilidad.
4+
5+
AsΓ­ es como en Python hacemos una solicitud HTTP GET:
6+
7+
```python
8+
response = requests.get('<destination url>')
9+
print(response.status_code)
10+
```
11+
12+
## πŸ“ Instrucciones:
13+
14+
Actualiza la variable `url` para que solicite a esta direcciΓ³n:
15+
16+
```bash
17+
https://assets.breatheco.de/apis/fake/sample/hello.php
18+
```
19+
20+
> Nota: La consola debe imprimir un cΓ³digo de estado 200.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 02 Creating a request
1+
# `01` Creating a Request
22

33
Python has a [requests package](https://requests.readthedocs.io/en/master/) that allows developers to create HTTP request pretty easily.
44

@@ -9,12 +9,12 @@ response = requests.get('<destination url>')
99
print(response.status_code)
1010
```
1111

12-
# πŸ“ Instructions
12+
## πŸ“ Instructions:
1313

14-
Change the variable url to make it request to:
14+
Update the `url` variable to make it request to this address:
1515

16-
```bash
16+
```text
1717
https://assets.breatheco.de/apis/fake/sample/hello.php
1818
```
1919

20-
Note: The console should print a 200 status code.
20+
> Note: The console should print a 200 status code.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import requests
2+
3+
url = "https://assets.breatheco.de/apis/fake/sample/hello.php"
4+
response = requests.get(url)
5+
6+
print("The response status is: "+str(response.status_code))

β€Žexercises/01-hello-world/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

β€Žexercises/01-what-is-a-request/README.es.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
Β (0)