Update requests exercise

This commit is contained in:
2024-01-14 00:15:52 +01:00
parent 17d758d75b
commit 72ccded05d
12 changed files with 195 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env python3
"""
Documentación Librería requests: https://requests.readthedocs.io/en/latest/
"""
import requests
# https://httpbin.org/post
payload = {'name': 'John Doe', 'age': 22, 'method': 'post'}
headers = {'User-Agent': 'my-invent-app/1.1.0'}
response = requests.post('https://httpbin.org/post', params=payload, headers=headers)
print(f"\n[+] URL final: {response.url}")
print(f"\n[+] Código fuente: {response.text}")