You've already forked Curso-lenguaje-python
Update requests exercise
This commit is contained in:
11
python-ofensivo/08_librerias/03_requests_07_file.py
Normal file
11
python-ofensivo/08_librerias/03_requests_07_file.py
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import requests
|
||||
|
||||
url = 'https://httpbin.org/post'
|
||||
my_file = {'archivo': open('example.txt', 'r')}
|
||||
|
||||
response = requests.post(url, files=my_file)
|
||||
|
||||
print(response.text)
|
||||
|
||||
Reference in New Issue
Block a user