You've already forked Curso-lenguaje-python
Update requests exercise
This commit is contained in:
15
python-ofensivo/08_librerias/03_requests_05_auth.py
Normal file
15
python-ofensivo/08_librerias/03_requests_05_auth.py
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import requests
|
||||
|
||||
# from requests.auth import HTTPBasicAuth
|
||||
# Con esta librería se podría detallar el método llamándolo así:
|
||||
# auth=HTTPBasicAuth('foo', 'bar')
|
||||
|
||||
# Paǵina para practicar autenticación: https://httpbin.org/basic-auth/foo/bar
|
||||
|
||||
response = requests.get('https://httpbin.org/basic-auth/foo/bar', auth=('foo', 'bar'))
|
||||
|
||||
print(f"\n[+] Código de error: {response.status_code}\n")
|
||||
print(response.text)
|
||||
|
||||
Reference in New Issue
Block a user