You've already forked Curso-lenguaje-python
Update requests exercise
This commit is contained in:
16
python-ofensivo/08_librerias/03_requests_02_post.py
Normal file
16
python-ofensivo/08_librerias/03_requests_02_post.py
Normal 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}")
|
||||
Reference in New Issue
Block a user